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

Attribute names are unconditionally lower-cased #41

Open
skywhale opened this issue Oct 1, 2020 · 5 comments
Open

Attribute names are unconditionally lower-cased #41

skywhale opened this issue Oct 1, 2020 · 5 comments

Comments

@skywhale
Copy link

skywhale commented Oct 1, 2020

This breaks some of the attributes like viewBox, which is case-sensitive.

Input:

<svg width="21" height="15" viewBox="0 0 21 15" />

output:

<svg width="21" height="15" viewbox="0 0 21 15"/>
@danhper
Copy link
Member

danhper commented Oct 6, 2020

Hi, I think that might be because of how cheerio handles that.
More of a workaround but would using the xml mode help?

@skywhale
Copy link
Author

Thank you. I confirmed that using xml mode preserves cases. It's not ideal, though, as it makes other non-HTML transformations like making <script> tags self-closing.

@danhper
Copy link
Member

danhper commented Oct 18, 2020

I agree it is not ideal but unfortunately, I do not think there is a simple fix because of the underlying library used: cheeriojs/cheerio#1096
If you think of a solution I would be happy to take a further look.

@skywhale
Copy link
Author

Yeah I don't have a good solution either. Please feel free to close the issue.

We have a simple regex script that runs after static-i18n to work around the issue and it's okay for us now. Thank you for looking into it :)

@danhper
Copy link
Member

danhper commented Nov 9, 2020

Thank you for the update (and sorry for the delay).
I'll leave this open in case somebody comes up with something!

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

No branches or pull requests

2 participants