-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[lexical-markdown] Option: $convertToMarkdownString with shouldPreserveWhitespaces #7972
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
base: main
Are you sure you want to change the base?
[lexical-markdown] Option: $convertToMarkdownString with shouldPreserveWhitespaces #7972
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This fails the formatting check (should be able to fix with |
|
Thank you for the report. It has been fixed. |
etrepum
left a comment
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.
The only thing missing here are tests to show that it does what it's supposed to
| $convertToMarkdownString([...TRANSFORMERS], undefined, false, true), | ||
| ); | ||
|
|
||
| expect(exported).toBe('** Hello **'); |
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.
Looking closer at what this is supposed to do now that there are tests I don't think this is useful, because this is not something most markdown parsers will accept.
For example here's what github does with it:
** Hello **
The commonmark reference implementation also doesn't parse it as formatting
[lexical-markdown] Option: $convertToMarkdownString with shouldPreserveWhitespaces
Description
By default, $convertToMarkdownString replaces whitespaces in somecases with HTML chars:
**   foo   **, while it's not a big deal when exporting from Lexical and then rendering into Lexical, it breaks on other Markdown renderers.