Giter Club home page Giter Club logo

Comments (2)

rdipardo avatar rdipardo commented on July 28, 2024

It looks like the above text was formatted by QuickXML. Browsing the code (which I can't debug because of issues with the Nuget packages), I see that ::writeEOL and ::writeIndentation are guarded by a condition that is false when text is encountered right before a closing tag:

else if (!(lastAppliedTokenType & (XmlTokenType::Text | XmlTokenType::CDATA | XmlTokenType::TagOpeningEnd | XmlTokenType::Undefined))) {

This means QuickXML will not insert a newline between text and a closing tag. In the sample text above, text is adjacent to a closing tag inside the innermost span:

       closing tag
       ...........
       v
<span>t</span>
      ^...
      text

Using one of the other formatters, the result is the same or even worse:

xmltools-formatters-compared

All the above were formatted with the same options:

Auto-close tags             True
Ensure conformity           False
Apply xml:space="preserve"  False

Go to Plugins > XMLTools > Options to find them:

xmltools-format-options

from xmltools.

theshoeshiner avatar theshoeshiner commented on July 28, 2024

@rdipardo Did you mean to say "SimpleXML"? Your screenshots match what I'm seeing. QuickXML actually produces correct indentation, SimpleXML produces the incorrect indentation that I initially encountered, and StringXML produces even worse indentation.

Im not sure why my installation was defaulting to SimpleXML, since on other machines a fresh install defaulted to QuickXML, but switching to QuickXML is a work-around for this specific issue.

from xmltools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.