Repository navigation
[lexical-mdast] Bug Fix: Escape the dot of www. so the characters after it import as typed #9956
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
Open
mayrang
wants to merge
3
commits into
meta:main
Choose a base branch
from
mayrang:www-reference
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+415
−5
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| '@lexical/mdast': patch | ||
| --- | ||
|
|
||
| [fix] With `MdastGfmExtension` or `MdastAutolinkLiteralExtension`, export escapes the `.` of `www.` in text whatever follows it, also where an inline element with no export rule, such as a `MarkNode`, splits the `www`, so the characters after it are read back as typed | ||
|
|
||
| Text that such an element splits is escaped as one text in general, so `1` before a mark of `. x` is written as `1\. x` instead of starting an ordered list. | ||
|
|
||
| Verify: export snapshots of text with `www.` before the marker of a format or a link, before a non-ASCII character beside formatting, or before punctuation that the export escapes, such as `www\.**x**` (formerly `www.**x**`), `www\.世**!**` (formerly `www.世**!**`, which was read back as a link to `http://www.世`, then `;` and `!`) or `www\.\*x` (formerly `www.\*x`). Plain `www.example.com` was written as `www\.example.com` already. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional, non-blocking:
before: '[Ww]{3}'needs all threews in the stringsafe()checks, butmdast-util-to-markdowngives a text node only the last character of its previous sibling asbefore. Awww.split across sibling text nodes, such as one where an inline element with no export rule (aMarkNode) starts insidewww, still goes out unescaped:see ww+ mark(w.世) + bold!exports assee www.世**!**and reads back as a link tohttp://www.世, then;.maindoes the same, so this is not a regression; joining adjacent text siblings before serializing, or a line in this comment about the limit, would cover it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Joined adjacent text siblings before serializing in f4e59ed, so the rule sees the whole
www. That also stops1+ mark(. x) from starting an ordered list.