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

Fix xmlMode for SVG tag #74

Closed
wants to merge 1 commit into from
Closed

Fix xmlMode for SVG tag #74

wants to merge 1 commit into from

Conversation

connected
Copy link

Inline SVG tag children should always be rendered in XML mode, otherwise "circle", "rect" and other self-closing tags will render unclosed.

Fixed missing self-closing tag for SVG element childer.
@osdiab
Copy link

osdiab commented May 8, 2018

Any chance is under consideration?

@AmeliaBR
Copy link
Contributor

As far as I could tell, this PR wasn't actually doing anything; there was already a test for <svg> that switches to xmlMode: true in the renderTag method at

dom-serializer/index.js

Lines 100 to 102 in 2aab6eb

function renderTag(elem, opts) {
// Handle SVG
if (elem.name === "svg") opts = {decodeEntities: opts.decodeEntities, xmlMode: true};

Nonetheless, there were a number of other aspects of SVG serialization that were problematic, see PR #76 . In particular, changing xmlMode in this script only fixes serialization, not DOM parsing.

@connected
Copy link
Author

connected commented Oct 23, 2018

@AmeliaBR,
you are right, this PR was created in context of an older version, where this fix has not been applied. My bad, closing.

@connected connected closed this Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants