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
It looks like support in deserializer seems to have a problem with markdown that should generate a leaf with multiple marks. This simple code demonstrates the issue.
importMarkdownSerializerfrom'slate-md-serializer'constSerializer=newMarkdownSerializer()consttest1="This is **_bold and italic_**."constd1=Serializer.deserialize(test1)console.log(JSON.stringify(d1,null,2))
I noticed that https://github.com/markedjs/marked handles my input correctly. It also seem to have more exhaustive rules than slate-md-serializer (but underscore is a new slate-md-serializer rule that cause problems). I am looking into this further. I did try updated the regex rules and captures to what marked is using, butit fails.
A quick debugging sessions shows that Renderer.prototype.strong and Renderer.prototype.em are both being called on my test input, but each time they create a new array of marks. My expected behavior would be the first call to create a marks array and the second call appends a mark to the existing one.
Is this something that would be committed if a sutable fix was found?
Is this something that would be committed if a sutable fix was found?
Absolutely, that would be great. The library also has extensive regression tests, I'd recommend a TDD approach to working with the lib – writing the failing test first.
It looks like support in deserializer seems to have a problem with markdown that should generate a leaf with multiple marks. This simple code demonstrates the issue.
outputs
The text was updated successfully, but these errors were encountered: