Comments (4)
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.
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.
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.
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)
- JSON broken with special strings ~#~ HOT 5
- Command line interface HOT 1
- XML pretty-print: Several pretty-print runs create additional newlines in each run HOT 2
- XML: Minify does strip whitespace within element HOT 2
- Variables not defined well for ES6 HOT 1
- Invalid new line inserted in CDATA block HOT 1
- Self closed elements break if they are inside element with the same name
- JSON pretty-printer doesn't handle strings well HOT 3
- When minifying json with strings containing brackets, spaces are trimmed HOT 2
- TypeError: Cannot read property 'replace' of null HOT 1
- XML namespaces gets double newlines
- status - still maintained?
- JSON minifying is too aggressive and alters strings
- No matching version found for [email protected].
- Global leak of maxdeep and ix still in 0.40.0 on npm
- Newlines are not trimmed in xmlmin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pretty-data.