fix: regression with unquoted attribute with trailing slash, revert bogus comment minification #1561
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.
Description
#1557 made it so that Marko would omit quotes around attributes that did not contain any invalid characters. However this added a regression for the last attribute if it had a trailing slash, ie:
If the
href
attribute was first, it would actually parse correctly, however the ambiguity above means that the<a>
is closed too early which caused the regression.The fix in this PR is to add a space if the unquoted attribute has a trailing slash.
This PR also reverts the comment minification from that PR. Although there was no regressions with that, and it is objectively smaller output, it does cause html linters and validators to complain. This may appear in a future version of Marko, but we need to re-evaluate.
Checklist: