summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2014-11-25Rename NODE_STRING -> NODE_TEXT.John MacFarlane
In JS, use 'Text' instead of 'Str'. In spec, use "plain textual content" instead of "strings."
2014-11-24Merge pull request #218 from nwellnhof/windows_fixesJohn MacFarlane
Windows fixes
2014-11-24Fix MSVC optionsNick Wellnhofer
Also disable some warnings.
2014-11-24Cast void* for MSVC compatibilityNick Wellnhofer
2014-11-24Validate UTF-8 inputNick Wellnhofer
Invalid UTF-8 byte sequences are replaced with the Unicode replacement character U+FFFD. Fixes #213.
2014-11-24Off-by-one error in utf8proc_detabNick Wellnhofer
2014-11-23Added 'fenced' flag to cmark_code struct, renamed from cmark_fenced_code.John MacFarlane
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).
2014-11-23Added internal flag to distinguish setext from atx headers.John MacFarlane
2014-11-23Do not distinguish btw fenced and indented code in AST.John MacFarlane
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.
2014-11-23Revert "Revert "Remove distinction btw atx and setext header in AST.""John MacFarlane
This reverts commit 4570eb2bff2e1b71fa5b6408abbc69c98ff5ff24.
2014-11-23Fix segfault on docs without trailing newlineNick Wellnhofer
2014-11-22Revert "Remove distinction btw atx and setext header in AST."John MacFarlane
This reverts commit a71423f6ee1b77d9f79d42599ea00b4ca99f5da0. Not quite sure about this change, so reverting for now. Note that we still have a distinction between fenced and indented code blocks in the AST. These two distinctions seem to stand or fall together.
2014-11-22Remove distinction btw atx and setext header in AST.John MacFarlane
Now we just have 'header' -- Setext and ATX are just two ways of forming these; it's not a semantic difference that should remain in the AST.
2014-11-22Renamed NODE_BQUOTE -> NODE_BLOCK_QUOTE.John MacFarlane
2014-11-22Fixed #192.John MacFarlane
The C and JS implementations were not registering blank lines after atx headers for purposes of tight/loose list calculation. Exmaple: * item * # block1 ## block2
2014-11-22Updated JS and C implementations for #209.John MacFarlane
A setext header was being treated a if it were a blank line for purposes of tight/loose list determination. Closes #209.
2014-11-22C html renderer: ensure newline before hr or raw html block.John MacFarlane
2014-11-22Fixed #214 C and JS implementations.John MacFarlane
They were gobbling whitespace after shortcut reference links, e.g. [foo] bar [foo]: url Closes #214.
2014-11-22Make parser accept a char*Nick Wellnhofer
2014-11-22Make render_html return a char*Nick Wellnhofer
2014-11-22Stackless HTML renderingNick Wellnhofer
Now that every node has a parent pointer, it's possible to implement the HTML rendering functions without render stacks and any dynamic memory allocations. This commit also adds some minor optimizations that eliminate some strbuf_put* calls for the common case and avoid printf for headers.
2014-11-22Fix debug flagsNick Wellnhofer
2014-11-22Fix and test node_checkNick Wellnhofer
2014-11-22Set defaults for new headers and listsNick Wellnhofer
2014-11-22More tree hierarchy checks and testsNick Wellnhofer
2014-11-21html: Simplified render_stack code.John MacFarlane
Now that we have just one node type, it is not necessary to have two separate 'push' functions.
2014-11-20Added utf8proc_is_space.John MacFarlane
2014-11-20Added utf8proc_is_punctuation.John MacFarlane
We'll probably need this when the spec for emph/strong gets revised.
2014-11-19Merge pull request #208 from nwellnhof/more_accessors_and_testsJohn MacFarlane
More accessors and tests
2014-11-19cmark: Add space before '/' in img tag.John MacFarlane
2014-11-19Input validation for settersNick Wellnhofer
2014-11-19Fix {get|set}_string_contentNick Wellnhofer
2014-11-19Accessors for start_line, start_column, end_lineNick Wellnhofer
These are read-only as they're only metadata returned by the parser.
2014-11-19Accessors for link titlesNick Wellnhofer
2014-11-19Accessors for fence infoNick Wellnhofer
Only fence info should be relevant for rendering. Accessors for other fenced code data could be added for completeness but they don't seem very useful.
2014-11-19Accessors for list dataNick Wellnhofer
Only 'list_type', 'start', and 'tight' should be relevant for rendering. Accessors for other list data could be added for completeness but they don't seem very useful.
2014-11-19Accessors for header levelNick Wellnhofer
2014-11-19Accessors for string content of code and HTML blocksNick Wellnhofer
2014-11-19Rename {get|set}_content to {get|set}_string_contentNick Wellnhofer
2014-11-19Add cmark_node_insert_after to cmark.hNick Wellnhofer
Fix copy/paste error.
2014-11-18Start with tests for the C APINick Wellnhofer
The C API tests can be run individually via build/api_test/api_test Or together with the spec tests via cmake --build build --target test
2014-11-18Add node constructor and accessors to the public APINick Wellnhofer
The approach I'm taking is to copy inline literals internally to NULL-terminated C strings if requested by an accessor. This allows to return a 'const char *' that doesn't have to be freed by the caller.
2014-11-18Make render_html support nodes with no childrenNick Wellnhofer
For empty inline nodes like EMPH, the parser always creates a child containing an empty string. Using the tree manipulation API, nodes with no children can be created. Adjust render_html to cope.
2014-11-18Initialize all fields in node when creating inlines.John MacFarlane
2014-11-18html: Removed union from RenderStack.John MacFarlane
It doesn't make sense to have a union here, and this simplifies the code.
2014-11-18Improve output of tree integrity checkNick Wellnhofer
2014-11-17Make sure the emph inline added in process_emphasis has a parent.John MacFarlane
2014-11-17Set CMARK_DEBUG_NODES for debug builds.John MacFarlane
2014-11-17Make parse_inlines add directly to parent.John MacFarlane
Previously parse_inlines returned a list of parsed inlines. This had to be added to the parent, and fix_parents had to be called to manually add the 'parent' links to the children, and the 'last_child' link to the parent. Now parse_inlines takes the parent block as a parameter, and uses cmark_node_append_child to add the children, so that the pointers should be properly managed. This avoids the need for the fix_parents pass.
2014-11-17Set last_child and parent in make_linkNick Wellnhofer