lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: markdown triple-backticks blocks get JavaScript lang-specifier added automatically after a markdown import-export rountdtrip (even when the content has not relation to JavaScript)

Open vadimkantorov opened this issue 9 months ago • 1 comments

Image

Image


Somehow javascript got added (probably as default highlighting language, but it's potentially very wrong) and also an empty newline got added after Hello

Image


As much of original Markdown should be preserved during import-export roundtrips, especially if the content were not edited. This would enable clean diffs when markdown being edited is under source/version control

vadimkantorov avatar Feb 22 '25 12:02 vadimkantorov

The new setting Preserve newlines in Markdown in v0.25.0 playground

Image

solves the extra-newline appearing (might be nice to have it enabled by default), but the javascript lang-specifier still appears in v0.25.0.

IMO the less markdown changes during import-export roundtrips - the better for markdown files editing WYSIWYG experience (as it keeps the diff clean). Maybe the most radical way for this would be to store the original markdown during import in the nodes, and if they were not edited - to emit the original markdown for them.

vadimkantorov avatar Feb 26 '25 15:02 vadimkantorov