Comments (11)
@infotexture Yeah that option was dropped after feedback from the community when I opened the PR to merge this plugin into prettier core.
from plugin-xml.
@kddnewton too bad that it was dropped as lack of this feature is a blocker for us going to 1.0.
Use case: we are cleaning up/standardizing formatting on XML that is returned to us via the Salesforce metadata API. They (salesforce) do not include a space before the ?>
on the xml version line nor do they on self closing elements. With xmlSelfClosingSpace: false the only files with a diff after the pull are ones that have a substantive change. This allows pretty-quick to run super fast because only a few files need to be prettified. With the 1.0 behavior we have thousands of files with whitespace only diffs that need to be cleaned up by prettier eliminating the significant speed improvements we get from pretty-quick.
from plugin-xml.
Ehh alright. You convinced me. I'll release that today.
from plugin-xml.
This is now on master as xmlSelfClosingSpace
from plugin-xml.
@kddeisz 🙏 Thanks for the initial implementation in b415dcf for 0.5.0.
The new option seems to work fine when added to the Prettier configuration file, for example as:
# .prettierrc.yaml
# https://github.com/prettier/plugin-xml/issues/11
xmlSelfClosingSpace: false
— but I get a warning when passing the new option via the CLI:
$ prettier --write "index.dita" --parser=xml --xmlSelfClosingSpace false
[warn] Ignored unknown option --xmlSelfClosingSpace=false.
index.dita 21ms
from plugin-xml.
@infotexture yeah on the command line it's --xml-self-closing-space
.
from plugin-xml.
@kddeisz Ah, right, easy to forget that. See #48 ☝️ for a proposal.
from plugin-xml.
@kddnewton The changelog says the xmlSelfClosingSpace
option that fixed this issue was removed from the 1.0.0 release.
Does that mean all instances of <foo/>
will revert to <foo />
, or is there some other way to preserve the tighter spaceless syntax in self-closing elements and XML declarations?
from plugin-xml.
I also have client projects that are sticking with the previous version for this reason. 😞
from plugin-xml.
Much appreciated.
Thank you. 🙏
from plugin-xml.
Thanks @kddnewton excited to be on the latest version and everything seems to be working great!
from plugin-xml.
Related Issues (20)
- Unstable attributes sorting HOT 2
- Support for inline XML DTD HOT 1
- Formatting not working on Salesforce xml files HOT 3
- Error on valid syntax HOT 6
- Preserve whitespace in empty `<xsl:text>` nodes HOT 3
- Plugin is overwriting tag content HOT 1
- Exception when formatting with prettier standalone in browser HOT 2
- Extension `Prettier - code formatter` is configured as formatter but it cannot format 'edmx'-files HOT 1
- Prettier doesn't detect at all HOT 1
- Processing instructions disrupt formatting HOT 3
- Text content including special characters may be interpretted as XML
- Text content is split around entities HOT 5
- XML attributes are uncommonly indented HOT 1
- Whitespace formatting isn't valid and idempotent with `ignore` sensitivity
- [Bug] Issue with Formatting XML Files in VSCode HOT 1
- not indenting HOT 3
- Chokes on doctype with custom entities HOT 3
- move comment before HOT 4
- npm package for 3.4.0 is missing files HOT 2
- Plugin doesn't work with latest version of prettier HOT 1
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 plugin-xml.