Milkdown / milkdown

🍼 Plugin driven WYSIWYG markdown editor framework.
https://milkdown.dev
MIT License
8.64k stars 386 forks source link

[Bug]/[Feature] Parser error with non-standard markdown content. Ability to suppress errors? #1396

Open PickleyD opened 1 month ago

PickleyD commented 1 month ago

Initial checklist

Affected packages and versions

7.4.0

Link to runnable example

No response

Steps to reproduce

Go to playground and enter - <!-- A comment --> in the raw markdown side.

Expected behavior

An error occurs but the editor remains responsive. - <!-- A comment --> appears as plain text in the markdown viewer/editor.

Actual behavior

Observe error in console of Uncaught (in promise) MilkdownError: Create prosemirror node from remark failed in parser... and editor crashing.

Is it possible for a consumer of the editor to configure it to catch/suppress errors such as this coming from the parser (and just parse the content as plain text), to avoid any full editor crashes resulting from unusual user input?

Runtime

Chrome

OS

macOS

Build and bundle tools

No response