Git Product home page Git Product logo

Comments (4)

vkiryukhin avatar vkiryukhin commented on August 19, 2024

It's not about self-closed element. It's about how xmlns attribute is processed. If you want to fix this particular issue, you can comment or remove lines 70, 71:

line#70   .replace(/xmlns\:/g,"~::~xmlns:")
line#71   .replace(/xmlns\=/g,"~::~xmlns=") 

it will fix your problem, but make xmlns attributes inline, instead of moving them on the next line and make them more visible/readable.

best regards,
--Vadim

from pretty-data.

marcofanch avatar marcofanch commented on August 19, 2024

Thanks for your reply.

I tried your method, it works for me.
But is it possible to keep the new line while maintaining the correct indentation of all other attrs and tags?

from pretty-data.

Vinorcola avatar Vinorcola commented on August 19, 2024

Hello,

I run into this issue today also. I agree with @marcofanch , this is an issue. The fact that xmlns is set on a new line should not affect the rest of the indentation.

Expected result:

<atag>
  <sometag
    xmlns="some-namespace"/>
</atag>

Current result:

<atag>
  <sometag
    xmlns="some-namespace"/>
  </atag>

Currently, we can notice that the closing tag for "atag" is not aligned...

from pretty-data.

delphin92 avatar delphin92 commented on August 19, 2024

This issue can be fixed like this:
d237256
Also, to prevent from the closing tag being moved to new line after xmlns attribute consider the following:
492a49c

from pretty-data.

Related Issues (17)

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.