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

Correct Unicode whitespace collapsing and improve flanking white space #315

Merged

Conversation

martincizek
Copy link
Collaborator

Tuned whitespace handling, especially when ASCII and nonASCII whitespace is used together. Based on this analysis.

Quality assurance:

  • One of the unit tests was adjusted to expect the right value. :)
  • Added tests for all eight reasonable combinations.
  • Added a test for false formatting, which was detected by integration tests in our project.

Performance:

  • Blank element with spaces detection avoided.
  • Edge whitespace matched in one regexp instead of two.
  • Should be slightly faster than before.

From the commit message:

@martincizek martincizek changed the title Respect original whitespace instead of using hardcoded 0x20. Correct Unicode whitespace collapsing and improve flanking white space Mar 31, 2020
@martincizek martincizek force-pushed the flanking-whitespace-improvements branch from c4dd88c to bf2bf00 Compare July 6, 2020 14:19
Do not merge ASCII and non-ASCII whitespace.
Make sure non-ASCII whitespace is moved out of inline elements to prevent generating broken Markdown.
Fix mixmark-io#102.
Fix mixmark-io#250.
@martincizek
Copy link
Collaborator Author

@pavelhoral Asking for a code review. Thanks.

Copy link
Collaborator

@pavelhoral pavelhoral left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Trailing non-breaking space not caught by trailing whitespace detection Preserve   entity
2 participants