portive / wysimark

The Wysiwyg Editor for Markdown: 100% CommonMark + GFM with Uploads and Image Resizing
Other
239 stars 41 forks source link

Markdown language extension #71

Open romulof opened 2 months ago

romulof commented 2 months ago

Problem

I can't extend markdown language.

Solution

An API that allows markdown syntax extension (which is supported by remark-parse) and a custom renderer for it.

Additionally it could have also an editor extension (more detail in use case bellow).

Use Case

The typical case is adding support for @ mentions. In the editor when I type @, the editor plugin displays a completion widget, the AST parses it with a special node type and the custom renderer renders a link to a user profile.

Alternatives

N/A

Context

These @ mentions are widely used and some CSMs also easily allow extensions with square braces, mimicking Wordpress' shortcodes: https://wordpress.com/support/wordpress-editor/blocks/shortcode-block/