Age | Commit message (Collapse) | Author |
|
|
|
PROG is overridable, CMARK is not.
Slight adjustment to #297.
|
|
Makefile fixes
|
|
<https://github.com/jgm/commonmark.js>
|
|
SRCDIR, DATADIR, and PROG should not be overridable.
|
|
There's no need to reconfigure if html_unescape.h or case_fold_switch.inc
were changed.
|
|
cmake doesn't (re)build the project if the tests are run. This change
allows to run "make test" without having to run "make" before, for
example after modifying source files or from a clean tree.
|
|
This allows to install to a location other than /usr/local without
invoking cmake manually.
|
|
|
|
Since $(BUILDDIR) depended on the phony target "check", it was always
considered out-of-date. So it was always rebuilt resulting in running
the "cmake" command again even if it was already run.
Add a new phony target "cmake_build" that always triggers the cmake build
and make $(PROG) depend on it.
Running "make" a second time now doesn't run cmake again.
|
|
|
|
|
|
|
|
|
|
Closes #295.
|
|
See #296.
|
|
Improve version information
|
|
|
|
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.
|
|
Closes #294.
|
|
|
|
|
|
This avoids an unnecessary free(0) -- and perhaps free(???).
However, ltrace reveals that there is still a free(0) happening,
with some other source.
|
|
|
|
|
|
|
|
This is a first step towards keeping the code for each kind of
block in a central place, rather than spread all over the code
base.
This is preparatory for a more modular structure, where each
type of block has a record describing how it is parsed and
finalized.
Eventually this will also contain functions for checking for
a block start, and metadata that determines how line data
should be handled.
There is a small performance penalty (about 3%?) but it seems
worth it.
|
|
|
|
This reverts commit 16b275eb7b83ccbea6ef18b1c62efa655a1d3759.
|
|
Previously we just kept it set on the bottom child.
But this will give a quicker determination of lastLineBlank.
|
|
|
|
|
|
Remove unnecessary return of value
|
|
Remove read of "top" property (always undefined)
|
|
Fix incorrect call to addChild with 3 arguments
|
|
Dead code: Remove line assigning to Parser's _lastLineBlank property
|
|
In other cases, there is no return, and no caller checks for a return
value.
|
|
|
|
Also, the assignment is unnecessary at this point.
|
|
It looks like the line is unused (the property is on Node objects).
|
|
Add field for user data to node
|
|
|
|
|
|
Caught by sjs! This also improves performance measurably.
|
|
|
|
|
|
|
|
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.
|