summaryrefslogtreecommitdiff
path: root/src/cmark.c
AgeCommit message (Collapse)Author
2020-02-09Add cmark_get_default_mem_allocator().John MacFarlane
API change: This adds a new exported function in cmark.h. Closes #330.
2017-04-03Print message to stderr when we abort due to memory demands.John MacFarlane
Closes #188. @nwellnhof - could you have a look and let me know if you think this is a bad idea or could be improved?
2017-01-03Revert "More sourcepos! (#169)"John MacFarlane
This reverts commit 9e643720ec903f3b448bd2589a0c02c2514805ae.
2017-01-03Revert "Change types for source map offsets (#174)"John MacFarlane
This reverts commit 4fbe344df43ed7f60a3d3a53981088334cb709fc.
2016-12-30Change types for source map offsets (#174)Nick Wellnhofer
* Improve strbuf guarantees Introduce BUFSIZE_MAX macro and make sure that the strbuf implementation can handle strings up to this size. * Abort early if document size exceeds internal limit * Change types for source map offsets Switch to size_t for the public API, making the public headers C89-compatible again. Switch to bufsize_t internally, reducing memory usage and improving performance on 32-bit platforms. * Make parser return NULL on internal index overflow Make S_parser_feed set an error and ignore subsequent chunks if the total input document size exceeds an internal limit. Make cmark_parser_finish return NULL if an error was encountered. Add public API functions to retrieve error code and error message. strbuf overflow in renderers and OOM in parser or renderers still cause an abort.
2016-12-20More sourcepos! (#169)Mathieu Duponchelle
* open_new_blocks: always create child before advancing offset * Source map * Extent's typology * In-depth python bindings
2016-06-24Reformatted.John MacFarlane
2016-06-06mem: Add a `realloc` pointer to the memory handlerVicent Marti
2016-06-06cmark: Implement support for custom allocatorsVicent Marti
2016-06-06cmake: Global handler for OOM situationsVicent Marti
2015-07-27Use clang-format, llvm style, for formatting.John MacFarlane
* Reformatted all source files. * Added 'format' target to Makefile. * Removed 'astyle' target. * Updated .editorconfig.
2015-06-25Changed version variables to functions.Andrius Bentkus
This is easier to access using ffi, since some languages, like C# like to use only function interfaces for accessing library functionality. fixes #60
2015-06-07Switch cmark_markdown_to_html over to size_tNick Wellnhofer
2015-03-15Added options parameter to cmark_markdown_to_html.John MacFarlane
2015-02-15Added options parameter to cmark_parse_document, cmark_parse_file.John MacFarlane
Also to some non-exported functions in blocks and inlines.
2015-01-23Improve version informationNick Wellnhofer
Add version number and string as macros and symbols. Version numbers can be easily compared, for example in the C preprocessor: #include <cmark.h> #if CMARK_VERSION < 0x020200 #error Requires libcmark 2.2.0 or higher #endif Storing the version in a global variable allows to check the library version at runtime. For example: if (CMARK_VERSION != cmark_version) { warn("Compiled against libcmark %s, but using %s", CMARK_VERSION_STRING, cmark_version_string); } The version should be updated whenever the public API is changed.
2014-12-29Added options parameter to renderers.John MacFarlane
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.
2014-12-04Moved source files from src/html into src.John MacFarlane
The separate directory presents problems for some simple extension building systems, like luarocks.
2014-11-28Removed cmark_free_nodes from public API.John MacFarlane
Replace it with static S_free_nodes.
2014-11-28Use prefixed names for symbols from references.hNick Wellnhofer
2014-11-22Make parser accept a char*Nick Wellnhofer
2014-11-22Make render_html return a char*Nick Wellnhofer
2014-11-17Move cmark_free_nodes to node.cNick Wellnhofer
2014-11-17Rename ast.h to parser.hNick Wellnhofer
2014-11-17Move inline-related stuff to inlines.cNick Wellnhofer
2014-11-17Remove old node_block and node_inlNick Wellnhofer
2014-11-17Switch cmark_node_inl over to cmark_nodeNick Wellnhofer
2014-11-17Switch cmark_node_block over to cmark_nodeNick Wellnhofer
2014-11-16Moved refmap from the top-level block node to the doc_parser.John MacFarlane
2014-11-16Added some basic functions for traversing/editing blocks in AST.John MacFarlane
2014-11-16Move inline function definitions to header filesNick Wellnhofer
Inline functions must be defined in header files in order to be inlined in other compilation units. This also fixes the MSVC build where out-of-line versions weren't created and allows to remove the -fgnu89-inline flag.
2014-11-16Probe for stdbool.hNick Wellnhofer
Let cmake create a cmark_config.h file to deal with platforms missing stdbool.h.
2014-11-16Use named enum typesNick Wellnhofer
Needed for C++ compatibility.
2014-11-16Cast void pointers explicitlyNick Wellnhofer
Needed for C++ compatibility.
2014-11-16cmark_render_html now just returns a regular C string.John MacFarlane
This way, we don't have to expose buffer.h; it is just used internally.
2014-11-16Moved AST details from public header cmark.h to private ast.h.John MacFarlane
2014-11-15Don't expose append_inlines.John MacFarlane
2014-11-14inline make_autolink.John MacFarlane
2014-11-13Added cmark_append_blocks, exposed more functions.John MacFarlane
2014-11-13Removed ast modules, moved these defs back to cmark.h.John MacFarlane
2014-11-13Rename cmark_free_nodes -> cmark_free_blocks.John MacFarlane
2014-11-11Improved cmark_markdown_to_html.John MacFarlane
Added length parameter so we can avoid strlen. Properly free buffer.
2014-11-11Added cmark_markdown_to_html with a simple interface.John MacFarlane
See #70.