Add exposing list markers *, -, +, or numeric to AST and API. #226
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.
Prior to this commit the node struct for a list contained a member to
store whatever char was parsed from the markdown, but this value
wasn't exposed through the API, nor was it made available in the
output of the AST in any format.
Following this commit a
cmark_marker_type
struct has been added tocapture various forms of list markers:
CMARK_NUMERIC_MARKER
(forordered lists) and
CMARK_ASTERISK_MARKER
,CMARK_HYPHEN_MARKER
, &CMARK_PLUS_MARKER
(for unordered lists). The value of which isstored in the
marker
member of thecmark_list
node struct.This enables two primary features:
markdown to markdown.
marker="hyphen"
(aswell as numeric, asterisk, and plus) as an attribute on the list
nodes. This is similar to the
delim="period"
attribute available onordered list nodes.
Tests have been added and are passing. The original test suite still
passes as well. This commit also updates the racket-lang wrapper to
support these new features as well as fixes a minor bug for a missing
no_delim
symbol becauseNO_DELIM
wasn't defined in cmark.hIf you'd like to see examples of the different results of running this through the updated
cmark
executable, then take a look at this Gist: https://gist.github.com/nathanaschbacher/93f45e938aef671a07e8c9f8850115cfFinally, this should close issue #225 that I opened earlier today.
Cheers!