You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Going to new line is broken on ordered and numbered lists (as well as nested lists).
There are numbered list, clicking enter should add number in new line as well. Instead an empty space is added.
I get the same issue with remark-slate-transformer. Maybe there is an issue with markdown serialization? I have recored the video below from remark-slate-transformer demo website. But I get exactly same issue in our internal editor using remark-slate. I would really appreciate if you have any input why this might be happening.
markdown-to-slate-issue.mov
The text was updated successfully, but these errors were encountered:
Imo the issue is that listItem contains a paragraph. If the paragraph isn't there, the list behaves as expected.
I implemented a custom snippet that removes the paragraph.
functionisListItem(node: Descendant): boolean{return"type"innode&&node.type==="listItem";}functionparseListItem(node: Element): Descendant{// Karol: https://github.com/hanford/remark-slate/issues/76// We ignore the paragraph inside the list item, because it breaks the newline behaviorconsttextNodes=[];for(constchildofnode.children){if("type"inchild&&child.type==="paragraph"){textNodes.push(...child.children);}else{textNodes.push(child);}}return{ ...node,children: textNodes};}constisText=(node: Descendant): node is Text=>"text"innode;exportfunctionremoveParagraphsFromListItems(nodes: Descendant[],): Descendant[]{returnnodes.map((node: Descendant)=>{if(isText(node)){returnnode;}if(isListItem(node)){returnparseListItem(node);}constchildren="children"innode ? node.children : [];return{
...node,children: removeParagraphsFromListItems(children),};});}
Going to new line is broken on ordered and numbered lists (as well as nested lists).
There are numbered list, clicking enter should add number in new line as well. Instead an empty space is added.
I get the same issue with remark-slate-transformer. Maybe there is an issue with markdown serialization? I have recored the video below from remark-slate-transformer demo website. But I get exactly same issue in our internal editor using remark-slate. I would really appreciate if you have any input why this might be happening.
markdown-to-slate-issue.mov
The text was updated successfully, but these errors were encountered: