-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
Lexical version: 0.31.2
Steps To Reproduce
- Go to https://playground.lexical.dev/
- Mark in the sentence
Make "sure to check "out the various[...](only mark the Text in double quotes and the trailing whitespace is important) and format it bold by pressing "B" Symbol - The trailing whitespace get's converted to HTML representation
 and behind the result will becomeMake **sure to check **out the various[...] - That is invalid common mark (and also gfm) and would other editors to print the surrounding "**" before and after.
- Please compare to this playground https://spec.commonmark.org/dingus/?text=test%20**test**%20test%5C%0Atest%20**test%20**%20test%5C%0Atest%20**test%20**test%5C%0Atest%20**test%26%2332%3B**test%5C%0Atest%20**test%26%2332%3B**%20test
Link to code example:
The current behavior
HTML space   is added, but space to following word is removed - which breaks Common Mark Syntax
The expected behavior
Any valid Common Mark dealing the trailing whitespace, see Step 5 in reproduction, to get a idea, what it could be (maybe examples are incomplete and there is much more)
Impact of fix
Happens always if within a text some words are marked to be formatted and makes it impossible to process the resulting Common Mark properly with other tools.
peter-siebold, lupuovidiul, vadimkantorov, hoffmanilya, reinseth and 4 more