Closed Trevald closed 4 years ago
I'm probably not going to debug this, but if you do and find a specific issue in this code, feel free to create a more precise bug report or pull request.
Understandable, I haven't dived so deep in to the code. But I'll give that a try and see if I can find anything. If not I will try and come up with a way to remove the extra paragraphs. Thanks for your reply.
So I've found that the problem is the schema used for list items. It's defined as:
list_item: {
content: "paragraph block*",
Changing to (paragraph | app_todo) solves the parsing issue but creates other issues since the ListItem class used by the editor uses a another schema. So I think I'll just need to put in the work and create my own list- and list item nodes.
Closing this issue since it's not a bug but rather expected behaviour defined by the schema.
I 'm parsing git hub todo list (- [x]) to be replaced by a custom node. I've written a plugin to replace paragraphs with my custom node by just switching type on open and close tag:
tokens[i - 1].type = "app_todo_open"
That doesn't seem to be a problem since the output from Markdown-it looks correct. But when running through MarkdownParser it generates an extra paragraph node before every app_todo node.
So without the custom node I get:
And with the custom node:
Breaks are set to false and when running it through only the markdown-it renderer I get the expected result:
Any ideas what can cause this?