-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes standalone mode & comment issues #29
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Switches print.js to require('prettier/standalone') which works in web builds. Running (node) tests all pass.
Closed
… issue where comment containing a comment containing a string like `<http://www.gnu.org/licenses/>` gets utterly transformed.
Added .idea to ignores (intelliJ/webstorm editor project files).
rart
changed the title
Standalone mode & Comment issues
Standalone mode, comment issues & !doctype preserve
Dec 16, 2019
This reverts commit f230921. Reverting since, including a new expression on the tagPattern regex changes indexes used by `parse` function breaking some of the parsing. This was breaking the `leaf` tests only apparently. Needs more careful inclusion to not break some of the other use cases.
rart
changed the title
Standalone mode, comment issues & !doctype preserve
Fixes standalone mode & comment issues
Dec 16, 2019
@kddeisz wondering if you have any thoughts on this? Also, once approved, what's the release cycle like? |
@rart a bit slammed at work but I'll take a look this weekend. I can release immediately after merging. |
@kddeisz Can you please make a point of looking at this PR? I've had to remove this plugin from all of my (Maven) projects, as it's breaking my builds as it is currently. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
"Standalone mode" / Bundler-friendly
Using plugin-xml on web(pack) builds (in my case a react app), results in unusually long build times and compiler warnings. Looks like same issue as #28
This PR switches
print.js
torequire('prettier/standalone')
instead of'prettier'
which works well in web builds and all (node) tests pass too.Any objections to this approach? Alternatively there could be a
standalone.js
(same pattern that prettier itself follows) that does a whole different "build" of the plugin and somehow refactorprint.js
andplugin.js
to minimize code duplication but seems unnecessary as this approach works fine.Comment Issues
In addition to #13 and #14 I found another issue where a comment containing the
<
and>
chars with a link inside gets utterly transformed.Expected:
Received:
I didn't realise about #30 until I had finished this but when I ran the changes on #30 with my XML updates - i.e. the ones on this PR - the tests didn't pass. Tests all pass with the changes on this PR as well as with the test XML on #30.