Age | Commit message (Collapse) | Author |
|
Introduce multi-purpose data/len members in struct cmark_node. This
is mainly used to store literal text for inlines, code and HTML blocks.
Move the content strbuf for blocks from cmark_node to cmark_parser.
When finalizing nodes that allow inlines (paragraphs and headings),
detach the strbuf and store the block content in the node's data/len
members. Free the block content after processing inlines.
Reduces size of struct cmark_node by 8 bytes.
|
|
Reduces size of struct cmark_node by 8 bytes.
|
|
Use zero-terminated C strings instead of cmark_chunks without storing
the length. This introduces a few additional strlen computations,
but overhead should be low.
Allows to reduce size of struct cmark_node later.
|
|
Use zero-terminated C strings instead of cmark_chunks without storing
the length. The length of code literals will be readded in a later
commit. strlen overhead for code info should be negligible.
Reduces size of struct cmark_node by 8 bytes.
|
|
With current HTML escaping, sometimes we may produce an XML tag like
<code_block> </code_block>
Many XML parsers consider these spaces insignificant and strip them
out but we need this. There's actually a test case like this in
spec.txt (search "A code block can have all empty lines as its
content:") and without proper hinting, an external xml->html converter
will fail the spec.
XML standard covers this case. If xml:space is "preserve", then
whitespaces are significant and should be kept. Add this hint for
text, code, code_block, html_inline and html_block tags.
|
|
|
|
They're not supported by MSVC.
|
|
Newer MSVC versions support enough of C99 to be able to compile cmark
in plain C mode. Only the "inline" keyword is still unsupported.
We have to use "__inline" instead.
|
|
|
|
|
|
API change. Sorry, but this is the time to break things,
before 1.0 is released. This matches the recent changes to
CommonMark.dtd.
|
|
1.0 - looking forward. We don't guarantee stability in
this until 1.0 is actually released, however.
|
|
Defined CMARK_NODE_HEADER to CMARK_NODE_HEADING to ease
the transition.
|
|
See jgm/CommonMark commit 0cdbcee4e840abd0ac7db93797b2b75ca4104314
Note that we have defined
cmark_node_get_header_level = cmark_node_get_heading_level
and
cmark_node_set_header_level = camrk_node_set_heading_level
for backwards compatibility in the API.
|
|
See jgm/CommonMark#87.
|
|
Instead of using their `as.literal` content, we now
give each custom node *two* literal fields, one to
be printed on entering the node (before rendering
the children, if any), the other on exiting (after
rendering children).
This gives us the flexibility to have custom nodes
with children.
|
|
|
|
These are passed through verbatim by all writers, with no
escaping.
They are never generated by the parser, and do not correspond
to CommonMark elements. They are designed to be inserted by
filters that postprocess the AST. For example, a filter might
convert specially marked code blocks to svg diagrams in HTML
and tikz diagrams in LaTeX, passing these through to the renderer
as a RAW_BLOCK.
|
|
|
|
See
http://talk.commonmark.org/t/output-of-t-xml-should-have-different-doctype-declaration/1893.
|
|
* Reformatted all source files.
* Added 'format' target to Makefile.
* Removed 'astyle' target.
* Updated .editorconfig.
|
|
|
|
|
|
|
|
There are probably a couple of places I missed. But this will only
be a problem if we use a 64-bit bufsize_t at some point. Then, we'll
get warnings from -Wshorten-64-to-32.
|
|
|
|
|
|
For consistency with the API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
So, instead of
<text>Hi</text>
<text>&</text>
<text>lo</text>
we get
<text>Hi&lo</text>
* Added exported `cmark_consolidate_text_nodes` function.
* Added `CMARK_OPT_NORMALIZE` to options.
* Added optional normalization in XML writer.
* Added `--normalize` option to command-line program.
* Updated man page.
|
|
|
|
|
|
|
|
|
|
To keep the API simple and avoid API changes when new options are
added, this is just a long integer.
Set it by disjoining options that are defined as powers of 2: e.g.
`CMARK_HTML_SOURCEPOS | CMARK_HTML_HARDREAKS`.
Test options using `&`: `if (options & CMARK_HTML_SOURCEPOS)`.
Added `--hardbreaks` and `--sourcepos` command-line options.
|
|
API exports cmark_node_get_column.
XML writer indicates start and end line and column for block-level
nodes.
|
|
|
|
This is a work-in-progress.
CommonMark.dtd gives the DTD for the generated XML.
Closes #53.
|