Age | Commit message (Collapse) | Author |
|
|
|
Closes #9, confirmed with ASAN.
Avoid using `parser->current` in the loop that creates new
blocks, since `finalize` in `add_child` may have removed
the current parser (if it contains only reference definitions).
This isn't a great solution; in the long run we need to rewrite
to make the logic clearer and to make it harder to make
mistakes like this one.
|
|
This arose when a paragraph containing only reference links and
blank space was finalized. Finalization would remove the
node. `finalize` returns the parent node, but the problem
arose because we had both `cur` and `parser->current`, and
only one was being updated. Solution: remove `cur`, which is
a holdover from before we had `parser->current`.
I believe this will close #9 -- @JordanMilne can you test and confirm?
|
|
|
|
This gives a small performance boost (0.37 to 0.36).
|
|
|
|
|
|
For consistency with the API.
|
|
|
|
|
|
This occurs in fiction: when a speaker has dialogue with
multiple paragraphs, a close quote is used only on the
final one.
Added test cases.
|
|
|
|
|
|
|
|
This allows backslash escapes to disable smart quote
transformations in particular cases.
Closes #8.
|
|
Also to some non-exported functions in blocks and inlines.
|
|
|
|
This bug was introduced after the modification in
009c3847f004fda437dd5376a9452973b1cb913e.
|
|
|
|
|
|
Previously we had 0.24s on the benchmark without `--smart`,
0.38s with it. Now we have 0.27s with `--smart`, so `--smart`
has only a small performance impact.
|
|
Also fixed some bugs in earlier smart handling. Now handles
UTF-8.
|
|
|
|
All tests now pass.
|
|
So far this is only implemented for the HTML renderer.
Ultimately some of this should be factored out into a form that
can be used in other renderers.
|
|
|
|
|
|
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.
|