Add Feature: strictXML Add options for working with a strict XML parser… #13
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.
... such as jspx which can mangle code and cause browsers to improperly format it to the user.
The Problem
I'm working on a project that utilizes Java's JSPX format which pre-processes HTML files served to the user. I am working on integrating a front-end build process to their workflow, but the JSPX processing is so heavy handed that there is absolutely no option for disabling some "features" that force empty tags into self terminating tags.
<script src="..."></script>
turns into<script src="..." />
,<link ...>
without a self terminated/
completely breaks compilation. I have looked into patching the behavior on the pre-processors end, but they give no options or concessions on that it needs to work that way.Proposed Solution
Add two options:
<link>
tag to make it self terminated<script>
tag with a CDATA tag in the empty spaceI have included a proper fix for pull request #12 and made it an option rather than forcing it for the user.
All tests and linting should be passing, although I had to make a concession to not pass the
options
object to the formatter and instead pass it to thebb
object because of some linting rules that were violated with number of arguments and number of statements in a function. Hopefully these are to the project's standards.Let me know if there's anything else I can do to get these options into the package. I'd prefer to use this widely accepted package vs. my one-off branch that includes these options for the small (but non-zero, if myself and #12 's show) amount of users who have this same problem.