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: Assign proper namespaces to foreignObject children #2119

Merged
merged 1 commit into from
Jun 25, 2021

Conversation

lishid
Copy link
Contributor

@lishid lishid commented Jun 6, 2021

📑 Summary

This fixes a bug where if the mermaid diagram is rendered directly (without being taken out as innerHTML and going through the HTML parser again after it was first rendered), journey diagrams will not properly show task text, due to these foreignObjects being created in the svg namespace. This patch adds the xhtml namespace for the div elements so that they are created in the proper namespace.

Illustration of the problem:
image

📏 Design Decisions

Inspired by the usage of xhtml:div here:

const div = fo.append('xhtml:div');

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added unit/e2e tests (if appropriate)
  • 🔖 targeted develop branch

@knsv knsv merged commit db049f9 into mermaid-js:develop Jun 25, 2021
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.

2 participants