Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
By the time we check for a list start, we've already checked
for an HRULE, so we don't need to repeat that check here.
Thanks to Robin Stocker for pointing out a similar redundancy
in commonmark.js.
|
|
|
|
Closes #9, confirmed with ASAN.
Avoid using `parser->current` in the loop that creates new
blocks, since `finalize` in `add_child` may have removed
the current parser (if it contains only reference definitions).
This isn't a great solution; in the long run we need to rewrite
to make the logic clearer and to make it harder to make
mistakes like this one.
|
|
This arose when a paragraph containing only reference links and
blank space was finalized. Finalization would remove the
node. `finalize` returns the parent node, but the problem
arose because we had both `cur` and `parser->current`, and
only one was being updated. Solution: remove `cur`, which is
a holdover from before we had `parser->current`.
I believe this will close #9 -- @JordanMilne can you test and confirm?
|
|
For consistency with the API.
|
|
|
|
Also to some non-exported functions in blocks and inlines.
|
|
|
|
Added assertion to raise an error if finalize is called
on a closed block (as was happening undetected because of
the fallback behavior).
|
|
|
|
|
|
This is a more logical arrangement and follows recent changes to
the JS implementation.
|
|
|
|
Closes #286.
|
|
Minor code reformatting:
This corrects an overzealous global replace from earlier.
|
|
|
|
|
|
Otherwise cmark's behavior varies unpredictably with the locale.
`is_punctuation` in utf8.h has also been adjusted so that everything
that counts all ASCII symbol characters count as punctuation, even
though some are not in P* character classes.
|
|
|
|
API exports cmark_node_get_column.
XML writer indicates start and end line and column for block-level
nodes.
|
|
|
|
Also break_out_of_lists.
|
|
|
|
In the last few commits we were using as.code.fenced and as.literal at
the same time for NODE_CODE_BLOCK, which obviously led to problems.
|
|
Reverts 225d720.
|
|
|
|
|
|
This is for consistency with the other types of nodes that have
literal strings as contents.
|
|
Modified finalize in blocks.c to return parent of finalized
block, so we can handle the case of reference definitions,
when we simply remove the finalized block.
|
|
This isn't needed any more since we don't expose these in the API.
|
|
This reverts commit b598b52a4acdc2332be3d34e30237d1b93b7dd03.
The change led to some problems, because some of the callers
of 'finalize' expected the node to exist after the call.
This could all be rewritten, but for now let's just revert.
|
|
There's no reason to store these empty nodes in the API.
The references have already been resolved.
|
|
The broken last_line_blank logic could lead to random failures in the
API tests.
|
|
The separate directory presents problems for some simple
extension building systems, like luarocks.
|
|
Fixes issue with Ctrl-D having to be pressed twice when reading from
terminal.
|
|
|
|
Replace cmark_parser_process_line with cmark_parser_push that takes
arbitrary chunks of data. Also fixes #211.
|
|
cmark_doc_parser => cmark_parser
cmark_new_doc_parser => cmark_parser_new
cmark_free_doc_parser => cmark_parser_free
cmark_finish => cmark_parser_finish
cmark_process_line => cmark_parser_process_line
cmark_node_destroy => cmark_node_free
Closes #223.
|
|
Previously, if malloc failed to allocate 'newstack', the function
would return without freeing 'stack'. Pointed out by clang static
analyzer.
|
|
Clang static analyzer pointed out that the value assigned to 'pos'
is never read.
|
|
|
|
|
|
|
|
Technically we could do without this, since we can check for
cmark_fence_length > 0. But it makes the code clearer and doesn't
really increase the size of the node struct (because the size of the
union is set by the data for lists).
|
|
|
|
Use a single CMARK_NODE_CODE_BLOCK tag for both.
Distinguish them when needed for parsing by looking at the
fence_length attribute, which is 0 for indented blocks.
|
|
This reverts commit 4570eb2bff2e1b71fa5b6408abbc69c98ff5ff24.
|