Skip to content
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

Don't lowercase attributes in html files #2367

Merged
merged 1 commit into from Dec 11, 2018

Conversation

DeMoorJasper
Copy link
Member

@DeMoorJasper DeMoorJasper commented Dec 6, 2018

↪️ Pull Request

Lowercasing html attributes breaks inline svg.

This PR changes the default to the posthtml default which is to not lowercase attributes.

💻 Examples

In the changed files you can see that the htmlnano test actually included broken inline svg code, due to the default previous to this pr.

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@m5o
Copy link

m5o commented Dec 7, 2018

Thanks to @DeMoorJasper for supporting on finding this issue.
SVG rendering is affected if viewBox attribute is converted to lowercase by posthtml.

-    <svg viewBox="0 0 32 32" v-bind:data-score="score">
+    <svg viewbox="0 0 32 32" v-bind:data-score="score">
       <circle v-bind:style="stroke" r="16" cx="16" cy="16" />
     </svg>
viewbox viewBox
screenshot 2018-12-06 at 23 01 56 screenshot 2018-12-06 at 23 01 00
Full example

📺 https://codesandbox.io/s/5jo8oywok

Reference

🔗 #1523

@devongovett devongovett merged commit 7db9fdd into master Dec 11, 2018
@devongovett devongovett deleted the fix-posthtml-svg-attributes branch December 11, 2018 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants