-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] markdown to document newline & image in paragraph #943
Comments
After searching for a fast solution I found the root error markdown_paragraph_parser is actually skipping images instead we should keep images List<List<md.Node>> _splitByBrTag(List<md.Node> nodes) {
return nodes
.fold<List<List<md.Node>>>(
[[]],
(acc, node) {
if (node is md.Element && node.tag == 'br') {
acc.add([]);
} else if (node is md.Element && node.tag == 'img') {
acc.add([node]);
} else {
acc.last.add(node);
}
return acc;
},
)
.where((group) => group.isNotEmpty)
.toList();
} After that if a node is an image inside a paragraph we should include it. |
Same Issue I'm facing while converting Markdown to Document. Markdown String
After Conversion:
IMAGE is missing after conversion. |
But this issue is not only for the images but for the Now I tried Image and Code block
And this time image parsed success fully but Code block is missing.
|
@adnan-nazir For the code block markdown parser, you need to import the appflowy_editor_plugins. Example code:
|
Bug Description
When converting a document to markdown we have this
After creating a document from markdown
Appflowy editor renders
How to Reproduce
create a new editor from markdown with the previous content.
Expected Behavior
The empty line should be rendered
THe image should be rendered
Note : the newline is correctly rendered by markdown renderer when exporting markdown from editor.
Operating System
android, ios
AppFlowy Editor Version(s)
latest
Screenshots
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: