You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using remark-slate to serialize content into Markdown, the library defaults to using the underscore _ character for italic text. However, this causes issues when italicizing text in the middle of a word. According to Markdown italic best practices, an asterisk * should be used instead of an underscore _ to avoid rendering inconsistencies across Markdown parsers.
The current output (Tes_t_ing) does not render correctly in many Markdown parsers. For compatibility and consistency, the library should use * for italicization, especially when the italicized segment is in the middle of a word.
Even using remark-parse + remark-slate to parse "Test_t_ing" once again would produce a text without italic but with visible underscores.
It really does feel more like a limitation of the remark-slate serializer more than a limitation of the parsers, given the current recommendations on best practices.
Steps to Reproduce:
Create a rich text structure where italicized text appears in the middle of a word.
Serialize the structure using remark-slate.
Observe that underscores _ are used for the italicized text, resulting in incorrect Markdown rendering.
And observe that the text surrounded by the underscores isn't italicized.
Proposed Solution:
Update the serialization logic to use * for italicized text when it appears in the middle of a word. This ensures proper rendering across Markdown parsers.
Ensure the library still supports underscores _ for italic text that is at word boundaries, as this is still valid Markdown.
Let me know if you need further details or clarification!
When using
remark-slate
to serialize content into Markdown, the library defaults to using the underscore_
character for italic text. However, this causes issues when italicizing text in the middle of a word. According to Markdown italic best practices, an asterisk*
should be used instead of an underscore_
to avoid rendering inconsistencies across Markdown parsers.Example:
Input Node:
Expected Markdown Output:
Actual Markdown Output:
The current output (
Tes_t_ing
) does not render correctly in many Markdown parsers. For compatibility and consistency, the library should use*
for italicization, especially when the italicized segment is in the middle of a word.Even using
remark-parse
+remark-slate
to parse"Test_t_ing"
once again would produce a text without italic but with visible underscores.It really does feel more like a limitation of the
remark-slate
serializer more than a limitation of the parsers, given the current recommendations on best practices.Steps to Reproduce:
remark-slate
._
are used for the italicized text, resulting in incorrect Markdown rendering.And observe that the text surrounded by the underscores isn't italicized.
Proposed Solution:
*
for italicized text when it appears in the middle of a word. This ensures proper rendering across Markdown parsers._
for italic text that is at word boundaries, as this is still valid Markdown.Let me know if you need further details or clarification!
Versions
The text was updated successfully, but these errors were encountered: