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

Make taggle compatible with xhtml #128

Merged
merged 1 commit into from
Aug 9, 2018
Merged

Make taggle compatible with xhtml #128

merged 1 commit into from
Aug 9, 2018

Conversation

FranklinWhale
Copy link
Contributor

@FranklinWhale FranklinWhale commented Aug 9, 2018

This PR allows Taggle to be used with a page served as application/xhtml+xml by:

  1. Replacing the × HTML entity with the × character directly

  2. Changing the tagFormatter return validation logic to check localName, which works in both application/xhtml+xml and text/html, and for compatibility with IE 8, tagName as fallback.

Fixes #129

@coveralls
Copy link

Coverage Status

Coverage remained the same at 89.957% when pulling f66287d on FranklinWhale:xhtml into ebfa55c on okcoker:master.

@FranklinWhale FranklinWhale mentioned this pull request Aug 9, 2018
@okcoker
Copy link
Owner

okcoker commented Aug 9, 2018

Can we make sure the localName and tagName get lowercased so we can compare apples to apples. I've never actually used localName before but MDN says it was once uppercase.

@FranklinWhale
Copy link
Contributor Author

tagName is always uppercase in HTML. It is likely lowercase in XHTML, but if the element is namespace prefixed (e.g. <x:li>), the prefixed tag name (x:li) is returned. In contrast, localName never returns the namespace prefix.

localName should be in lowercase for both HTML and XHTML if the browser conforms to the HTML or DOM specification. IE >=9 and the latest versions of Edge, Firefox and Chrome all meet the requirement. Since the check falls back to tagName, browsers that do not localName or has incorrect implementation will work just fine.

@okcoker okcoker merged commit fda1ab2 into okcoker:master Aug 9, 2018
@FranklinWhale
Copy link
Contributor Author

Thanks! This fixed #129

@FranklinWhale FranklinWhale deleted the xhtml branch August 10, 2018 06:45
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