Skip to content

Conversation

@octaviancorlade
Copy link
Contributor

Removes the necessity of declaring a new namespace for each <title> using the xhtml:body tag, since there is only one xhtml:pre for each title in any case.

Working on Chrome 60.0.3112.113, FF 55.0.3, Safari 10.1.2, IE11.

Fixes #214

@octaviancorlade
Copy link
Contributor Author

octaviancorlade commented Sep 27, 2017

Just to keep track of what was found with some more testing (see comments on Issue #214):

No reason to use xhtml:pre instead of pre, since the namespace is removed in d3.selection.append() and therefore doesn't affect the result.

No reason to remove the foreignObject tag, which would be semantically more correct.

Just removing the .append("xhtml:body") should be enough.

Consistency in appending .html() or .text() would be a good idea, probably using .text() with \n for new lines is easier inside pre.

@cjyetman
Copy link
Collaborator

I haven't actually tested this, but based on the discussion and what I know/remember, this gets my seal of approval. Using the <foreignObject> tag I think is necessary for older browser compatibility, but use of the <body> tag, namespaced or not, seems to cause conflicts with other JavaScript packages when they select elements in the DOM.

@cjyetman
Copy link
Collaborator

this would probably fix #250 as well

@cjyetman
Copy link
Collaborator

cjyetman commented Apr 9, 2019

The problem that this was intended to workaround has been fixed upstream in shiny, so I'm not sure this needs to be merged anymore. Will leave open for now though as this may be a better strategy than the current one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants