Skip to content

Do not preprocess Unicode newlines in Markdown preview#166026

Merged
mjbvz merged 2 commits intomicrosoft:mainfrom
miyaokamarina:fix-166015
Nov 10, 2022
Merged

Do not preprocess Unicode newlines in Markdown preview#166026
mjbvz merged 2 commits intomicrosoft:mainfrom
miyaokamarina:fix-166015

Conversation

@miyaokamarina
Copy link
Contributor

@miyaokamarina miyaokamarina commented Nov 10, 2022

Remove Unicode newline characters U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR preprocessing from the Markdown preview.

This behavior was introduced in #63936 to address #63749, but it breaks the document in multiple ways:

  • double-click word selection does not work as expected,
  • screen readers may announce the text incorrectly,
  • line wrapping and hyphenation does not work correctly,
  • markdown-it plugins that rely on \b or \s may work incorrectly,
  • even linkify fails:
https://foo.bar/baz<LS>Lorem ipsum
(Expected link: https://foo.bar/baz)
(Received link: https://foo.bar/bazLorem)
  • and so on.

Since then it was fixed at the markdown-it side, and #63936 is no longer needed:

Fixes #166015

@mjbvz mjbvz added this to the November 2022 milestone Nov 10, 2022
@mjbvz mjbvz enabled auto-merge (squash) November 10, 2022 19:45
@mjbvz
Copy link
Collaborator

mjbvz commented Nov 10, 2022

Thanks!

@mjbvz mjbvz merged commit aa37e17 into microsoft:main Nov 10, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unicode newline characters are handled incorrectly in Markdown preview

2 participants