Closed igorlesnenko closed 5 years ago
😢
It's technically correct. If you run that markdown through remarkable it will still render properly, you don't individually number an ordered list in html.
On Tue, Aug 14, 2018, 3:56 PM Rose notifications@github.com wrote:
😢
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Rosey/markdown-draft-js/issues/71#issuecomment-413041994, or mute the thread https://github.com/notifications/unsubscribe-auth/AWSGaHYox7u1qRw-jKjfklRDk0DkeECAks5uQ1WXgaJpZM4V9Ox7 .
I totally misread the issue, disregard the above :D .
On Tue, Aug 14, 2018, 6:37 PM Nicholas Bowen nicholas.w.bowen@gmail.com wrote:
It's technically correct. If you run that markdown through remarkable it will still render properly, you don't individually number an ordered list in html.
On Tue, Aug 14, 2018, 3:56 PM Rose notifications@github.com wrote:
😢
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Rosey/markdown-draft-js/issues/71#issuecomment-413041994, or mute the thread https://github.com/notifications/unsubscribe-auth/AWSGaHYox7u1qRw-jKjfklRDk0DkeECAks5uQ1WXgaJpZM4V9Ox7 .
Also for some reason
Numeration like 1. 2. 3.
converted to 1. 1. 1.
Also for some reason Numeration like 1. 2. 3. converted to 1. 1. 1.
This has been fixed
The other main bug I haven't fixed yet as a quick test on https://rosey.github.io/markdown-draft-js/ I'm not seeing the behaviour described (there does seem to be the extra newline when I try it out) and I haven't tried digging any deeper than that yet!
Hi Rosey! First of all, really great project here: this has absolutely been a lifesaver, and fits my use-case almost 100%.
I'm experiencing what I believe to be the issue described above. If I create text in Draft.js which displays as such:
and export/reload, it displays as:
The exported markdown looks like:
"This is a test list.\n\n\n- Imagine\n- A world\n- Without lists\nHard, isn't it."
My config is pretty vanilla, though my export looks like this:
draftToCustomMarkdown = (editorState) => {
const rawContent = convertToRaw(editorState.getCurrentContent());
const customMarkdownOptions = {
styleItems: {
VARIABLE: {
open: () => '${',
close: () => '}',
},
},
preserveNewlines: true,
};
return draftToMarkdown(rawContent, customMarkdownOptions).replace(/\\_/g, '_');
}
and I'm loading it back with
const rawContent = markdownToDraft(this.props.text, { preserveNewlines: true });
I'm on version 1.2.1. Let me know if I can give any additional info which would be helpful.
@mikeappell thanks for putting together this detailed description and I'm sorry I haven't found the time yet to try out your recreation for myself! But I really appreciate you commenting on the issue with this 🙌
Let's say in draft-js we have following content:
That is converted to markdown as:
There should be a line between last list element
three
and thenext line
. Otherwise,next line
is considered as a part of the list.