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 issue with XML line breaks inside vertex labels #824

Merged
merged 3 commits into from
Jun 11, 2019

Conversation

jsyang
Copy link
Contributor

@jsyang jsyang commented Apr 18, 2019

The regex needed to match the <br> or <br/> wasn't completely correct as there is an attempt to turn <br> elements into their XHTML counter-parts <br/> later in the flowRenderer sequence. This fixes the regex so both will match.

You can test this yourself with this MMD file:

graph LR

ap[Admin Web App]
hs[Host Server]
pa{Platform<br>Administrator}

pa --- |manages accounts| ap
ap --- |syncs accounts| hs

Without fix:

without-fix

With fix

with-fix

The regex needed to match the `<br>` or `<br/>` wasn't completely correct since some browsers (e.g. Chrome) attempt to turn `<br>` elements into their XHTML counter-parts: `<br/>`. This fixes the regex so both will match.
@coveralls
Copy link

coveralls commented Apr 18, 2019

Pull Request Test Coverage Report for Build 747

  • 1 of 2 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 54.254%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/diagrams/flowchart/flowRenderer.js 1 2 50.0%
Totals Coverage Status
Change from base Build 716: -0.002%
Covered Lines: 2051
Relevant Lines: 3755

💛 - Coveralls

@knsv knsv merged commit fa9cf2b into mermaid-js:master Jun 11, 2019
@knsv
Copy link
Collaborator

knsv commented Jun 11, 2019

Thanks for your efforts!

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.

3 participants