Closed golmansax closed 5 years ago
Hey @golmansax โ thanks for taking a stab, if you're able to get the existing and new tests passing I'll be happy to merge a solution.
@tommoor Was able to get this to pass CI, let me know what you think!
The changes make sense, although I do think ideally the text inside the multiline blockquote should be split into individual paragraphs nodes.
I'm trying to get this to work correctly with https://github.com/outline/rich-markdown-editor but haven't had success thus far.
Hm, I think you're right. Let me try again.
@tommoor Was able to get it working so that paragraphs are nested within blockquotes. I also tested it on a live project so this time I feel better about the result. However, there's a check for obj.type === 'block-quote'
that I'm not too proud of.
What do you think?
Thanks! This works pretty well in my testing, one thing that's a bit strange is that having a list in a blockquote appears to add extra paragraphs above on serialize/deserialize โ I wonder if that's related to the special case you had to add?
Hmm let me add a test for that and debug.
I'm also working on https://github.com/tommoor/slate-md-serializer/pull/11 in conjunction because my project requires all of the empty paragraphs to be removed, so my live testing probably won't catch empty paragraph issues.
@tommoor I added a test in 3c9c5e8 which I think describes the list in a blockquote example you mentioned. I didn't see the issue with empty paragraphs being added. See anything different between the test and the use case you were describing?
It may have been multi-line quote specific - try creating a multiline quote with a list within.
๐
Added a second list-item to the quote in 64cc629 but it still has no empty paragraphs.
Tested in all the scenarios I can think of, great bug fix โย sorry for the delay in merging ๐
Multi-line blockquotes weren't being parsed correctly so I took a stab at solving it. Not sure if I found the correct solution though.
Issue:
Was incorrectly creating a blockquote with text
"Quote1Quote2"