Age | Commit message (Collapse) | Author |
|
Closes #188.
@nwellnhof - could you have a look and let me know if you
think this is a bad idea or could be improved?
|
|
This reverts commit 9e643720ec903f3b448bd2589a0c02c2514805ae.
|
|
This reverts commit 4fbe344df43ed7f60a3d3a53981088334cb709fc.
|
|
* 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.
|
|
* open_new_blocks: always create child before advancing offset
* Source map
* Extent's typology
* In-depth python bindings
|
|
|
|
|
|
|
|
|
|
* Reformatted all source files.
* Added 'format' target to Makefile.
* Removed 'astyle' target.
* Updated .editorconfig.
|
|
This is easier to access using ffi, since some languages, like C#
like to use only function interfaces for accessing library
functionality.
fixes #60
|
|
|
|
|
|
Also to some non-exported functions in blocks and inlines.
|
|
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.
|
|
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.
|
|
The separate directory presents problems for some simple
extension building systems, like luarocks.
|
|
Replace it with static S_free_nodes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
Let cmake create a cmark_config.h file to deal with platforms missing
stdbool.h.
|
|
Needed for C++ compatibility.
|
|
Needed for C++ compatibility.
|
|
This way, we don't have to expose buffer.h; it is just used
internally.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Added length parameter so we can avoid strlen.
Properly free buffer.
|
|
See #70.
|