We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've recently updated remark-slate-transformer from v0.2.1 to v0.7.3 and that introduced a breaking change for me with the generated Slate AST.
Previously, parsing an empty string (or a string with only whitespaces) would generate an empty array as a result of processSync.
const processor = unified().use(markdown).use(remarkToSlate); const value1 = processor.processSync('').result; // => [] const value2 = processor.processSync(' ').result; // => [] const value3 = processor.processSync('val').result; // => [{"type": "paragraph", "children": [{"text": "val"}]}]
After updating remark-slate-transformer I am receiving a slightly different response.
const processor = unified().use(markdown).use(remarkToSlate); const value1 = processor.processSync('').result; // => [[{"text": ""}]] const value2 = processor.processSync(' ').result; // => [[{"text": ""}]] const value3 = processor.processSync('val').result; // => [{"type": "paragraph", "children": [{"text": "val"}]}]
These two results are not marked as paragraph nodes, which makes Slate freak out.
paragraph
Is this the expected behavior? how do I make sure that remark-slate-transformer returns a paragraph node as root if nothing else is parsed?
The text was updated successfully, but these errors were encountered:
It is the behavior introduced in #42 . The bug was caused by empty list, so it might be better to fix only list not all nodes.
Sorry, something went wrong.
Published in 0.7.4.
0.7.4
Thanks for the quick fix @inokawa. I can confirm that it works properly and slate is no longer confused :)
inokawa
Successfully merging a pull request may close this issue.
I've recently updated remark-slate-transformer from v0.2.1 to v0.7.3 and that introduced a breaking change for me with the generated Slate AST.
Previously, parsing an empty string (or a string with only whitespaces) would generate an empty array as a result of processSync.
After updating remark-slate-transformer I am receiving a slightly different response.
These two results are not marked as
paragraph
nodes, which makes Slate freak out.Is this the expected behavior? how do I make sure that remark-slate-transformer returns a paragraph node as root if nothing else is parsed?
The text was updated successfully, but these errors were encountered: