After i convert the node to markdown, it removes nested
elements.
This is how i use the convertToMarkdownString
import { $convertToMarkdownString, TRANSFORMERS } from '@lexical/markdown'; let md = editorState.read(() => $convertToMarkdownString( TRANSFORMERS ) );
NOTE: The images of logs is of logs of the variable, editorState
This is how the message is structured before the markdown:
and after the convert, the output is:
"- helloworld"
When i want it to be
"- hello
" - world
Node that "hello" was in the first TextNode and "world" was in the second TextNode in the nested list.
It looks like the convertToMarkdownString just smashes them together.
The message structure after i save the converted markdown:
Lexical version: 0.12.2
Steps To Reproduce
Have a message that is structured like
<ul><li><span>hello</span><ul><li><span>world</span></li></ul></li></ul>
After i convert the node to markdown, it removes nested
elements. This is how i use the convertToMarkdownString- Have a message that is structured like
- Convert that message to markdown
import { $convertToMarkdownString, TRANSFORMERS } from '@lexical/markdown';
let md = editorState.read(() => $convertToMarkdownString( TRANSFORMERS ) );
NOTE: The images of logs is of logs of the variable, editorState This is how the message is structured before the markdown:and after the convert, the output is: "- helloworld" When i want it to be "- hello " - world Node that "hello" was in the first TextNode and "world" was in the second TextNode in the nested list. It looks like the convertToMarkdownString just smashes them together.
The message structure after i save the converted markdown:
Lexical version: 0.12.2
Steps To Reproduce
<ul><li><span>hello</span><ul><li><span>world</span></li></ul></li></ul>