Age | Commit message (Collapse) | Author |
|
|
|
|
|
Backslash escapes not allowed in autolinks.
|
|
|
|
|
|
Add a new template cmark_version.h.in to generate cmark_version.h
containing version information.
|
|
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.
|
|
|
|
|
|
This avoids an unnecessary free(0) -- and perhaps free(???).
However, ltrace reveals that there is still a free(0) happening,
with some other source.
|
|
|
|
|
|
|
|
Added assertion to raise an error if finalize is called
on a closed block (as was happening undetected because of
the fallback behavior).
|
|
To prevent intra-word emphasis, we used to check to see if
the delimiter was followed/preceded by an ASCII alphanumeric.
We now do something more elegant: whereas an opening `*` must
be left-flanking, an opening `_` must be left-flanking *and not
right-flanking*. And so on for the other cases.
All the original tests passed except some tests with Russian
text with internal `_`, which formerly created emphasis but no
longer do with the new rule. These tests have been adjusted.
A few new test cases have been added to illustrate the rule.
The C and JS implementations have both been updated.
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
Don't store length of UTF-8 string. It can be computed by
NULL-terminating strings shorter than 4 bytes and using strnlen.
Use gperf's string pool option. This allows to use an 'int' index into the
string pool instead of a pointer and is helpful on 64-bit systems.
Shaves about 75 KB off the 32-bit binaries on Linux and 128 KB off the
64-bit binaries on OS X.
|
|
|
|
* Advance to the next node when calling 'cmark_iter_next', not when
calling 'cmark_iter_get_node'.
* Add 'cmark_iter_get_event_type' accessor.
* Allow deletion of nodes after an 'EXIT' event, or an 'ENTER' event for
leaf nodes.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
Note: this only affects inline parsing. Block parsing
is handled differently.
|
|
|
|
This fixes the output of newlines.
|
|
|
|
|
|
MSVC doesn't support va_copy.
|
|
|
|
This reverts commit 485ef21b95e257e9d9cbcaa804c3c164f1f49a80.
Apparently the va_copy IS needed, because without this code
we get segfaults in some cases.
Closes #253.
@nwellnhof, can you have a look at this issue and comment?
I understand that this code was removed for portability reasons.
Is there an alternative solution?
|
|
This reverts commit 46b67b710788be7924b5a412ab68eea3cac0cd96.
I was mistaken that this helped. Which is good, because I would
not have understood why it helped.
|
|
We get segfaults on some platforms when we do
cmark_strbuf_printf(man, " (%s)", cmark_node_get_url(node));
but they go away with:
url = cmark_node_get_url(node);
cmark_strbuf_printf(man, " (%s)", url);
I don't understand why.
Closes #253.
|
|
Use a single lookup table for all character types.
I'm not sure this actually helps so much.
|
|
|
|
|
|
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.
|
|
|
|
|