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

Extend the br tag regex #1156

Merged
merged 2 commits into from
Dec 31, 2019
Merged

Conversation

gene1wood
Copy link
Contributor

Summary

This extends the br tag regex to accommodate an arbitrary amount of
any type of whitespace instead of a single space character, which holds
more closely to the HTML spec1

This extends the fix to #702 added in #1153

Design Descisions

This replaces the use of ?\/> with \s*\/> which changes two things

  • It allows for the other 3 whitespace characters beyond the space character
  • It allows for 0 or more whitespace characters instead of only 0 or 1.

This extends the `br` tag regex to accommodate an arbitrary amount of
any type of whitespace instead of a single space character, which holds
more closely to the HTML spec[1]

This extends the fix to mermaid-js#702 added in mermaid-js#1153

[1]: http://www.w3.org/TR/REC-xml/#sec-starttags
@IOrlandoni
Copy link
Member

Hey @gene1wood! Thank you very much for your contribution.
Is there any chance you could do tests for what you fixed?

This adds tests for the case where
* multiple pieces of whitespace are used
* one of those whitespace characters is a tab
@gene1wood
Copy link
Contributor Author

@dunning-kruger I added what I think are tests, I followed GDFaber's example and I don't actually know what I'm doing so hopefully this is right. Could you glance at b4f9dd4 and see if it looks right?

@IOrlandoni IOrlandoni requested a review from knsv December 23, 2019 19:00
Copy link
Collaborator

@knsv knsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thorough job, thanks!

@knsv knsv merged commit d5e9f2e into mermaid-js:develop Dec 31, 2019
@gene1wood gene1wood deleted the extend_br_tag_regex branch December 31, 2019 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph: Sequence Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants