Trying to include blockquote-admonitions. #1195
-
Im trying to include the blockquote admonitions like discussed in https://github.com/orgs/community/discussions/16925. I have tried to include the plugin https://github.com/myl7/remark-github-beta-blockquote-admonitions using
But this does not work. Am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
The plugin seems won't change the AST of blockquote. It just check the first line of blockquote and modify the html output. If you want to implement something similar in milkdown. You'll need to change the AST of the blockquote (like create a new node). You can see how I implemented the image block here: https://github.com/Milkdown/milkdown/blob/main/packages/components/src/image-block/remark-plugin.ts In your case, you'll need to check the first paragraph in blockquote's children and create a new node if it matches some pattern. |
Beta Was this translation helpful? Give feedback.
-
@Saul-Mirone But now im getting the following error every time i try to load the editor.
I am creating the following AST node in the remark plugin
defined a
i also hit the debugger point but then in the function The editor is configured like so:
Is there something else I am missing? |
Beta Was this translation helpful? Give feedback.
The plugin seems won't change the AST of blockquote. It just check the first line of blockquote and modify the html output.
If you want to implement something similar in milkdown. You'll need to change the AST of the blockquote (like create a new node). You can see how I implemented the image block here: https://github.com/Milkdown/milkdown/blob/main/packages/components/src/image-block/remark-plugin.ts
In your case, you'll need to check the first paragraph in blockquote's children and create a new node if it matches some pattern.