Fix skipping of text nodes in markdown parser #1
+85
−33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add blank implementations for TextNode and Text
Add more blanket implementations to cover
&str
,String
conversionsinto
TextNode
andString
TextNode
,Vec<TextNode>
and&[TextNode]
forText
.This simplifies the conversions between types. For instance one helper
function
text
from the markdown test module was removed and replacedwith
.into()
calls.Module: basalt-core
Scope: markdown
Fix skipping text nodes in markdown parser
Previously, quite naively every 'unhandled' tag was pushed as a new
paragraph node, however, this did not work as expected and actually
might replace the current node, even, if that wasn't the intention.
This happened for example with styled text using emphasis or bold
markers.
This is now fixed and the tags that do not have implementation are not
handled at all as separate nodes, but instead if they contain text. This
text will be pushed to the current node block instead.
New more comprehensive test was also added and replaces the simple block
quote test.
Module: basalt-core
Scope: markdown
Bump basalt-core to version 0.2.2
Update CHANGELOG.
Module: basalt-core