Commit Graph

19 Commits

Author SHA1 Message Date
Nick Wellnhofer
75870fbc45 Minor fixes to xml2md.xsl
- Remove outdated comment
- Fix code block delimiter
2018-09-14 15:52:32 +02:00
Nick Wellnhofer
0707ada63b XSLT stylesheet to convert cmark XML back to Commonmark
Initial version of an XSLT stylesheet that converts the XML format
produced by `cmark -t xml` back to Commonmark.

Fixes #264
2018-09-14 12:48:10 +02:00
Yuki Izumi
64e1394ae7 Fix for non-matching entities (#161)
* Add test to illustrate issue

* Provide some test fixes

* Don't neglect CounterClockwiseContourIntegral

* Fix ~10% of cases not matching

strncmp returns 0 if the first 'len' bytes of cmark_entities[i].entity
match s; we check equal length in the first if by checking if
cmark_entities[i].entity[len] == 0, but we neglect the case where cmp ==
0 && cmark_entities[i].entity[len] != 0.  This should be treated as the
same as cmp < 0, because strcmp("abc", "abcd") < 0.

* Don't depend on py3.3 in tests
2016-11-04 23:04:48 +01:00
Nick Wellnhofer
8bff268ba8 Test with multiple MSVC versions under Appveyor 2016-03-12 11:04:37 +01:00
John MacFarlane
2fa54428e2 Renamed entities.h -> entities.inc.
Also tools/make_entities_h.py -> tools/make_entitis_inc.py.
2015-06-17 08:05:57 -07:00
John MacFarlane
7e7819e05e Simpler approach for entity lookup.
We dispense with the hashes and just do string comparsions.
Since the array is in order, we can search intelligently
and should never need to do more than 8 or so comparisons.

This reduces binary size even further, at a small cost
in performance.  (This shouldn't matter too much, as
it's only detectable in really entity-heavy sources.)
2015-06-16 17:33:48 -07:00
John MacFarlane
54c087d127 make_entities_h.py: confirm there are no hash collisions.
At least with valid data.
2015-06-16 16:31:52 -07:00
John MacFarlane
76ed9a65b0 Mark entity data structures as const. 2015-06-16 14:24:59 -07:00
John MacFarlane
9f1bb45d9b entities: Make the first entity in the array (TripleDot) work.
We now use -1 instead of 0 to indicate leaf nodes.
2015-06-16 13:24:05 -07:00
John MacFarlane
208c794def Replace gperf-based entity lookup with binary tree lookup.
The primary advantage is a big reduction in the size of
the compiled library and executable (> 100K).

There should be no measurable performance difference in
normal documents.  I detected a slight performance
hit (around 5%) in a file containing 1,000,000 entities.

* Removed `src/html_unescape.gperf` and `src/html_unescape.h`.
* Added `src/entities.h` (generated by `tools/make_entities_h.py`).
* Added binary tree lookup functions to `houdini_html_u.c`, and
  use the data in `src/entities.h`.
2015-06-16 12:59:47 -07:00
John MacFarlane
be19ec3025 Removed spec-specific files (DTD, spec generation tools). 2015-01-24 21:10:44 -08:00
John MacFarlane
d6c615f268 Removed JS implementation, which is moving to its own repo:
<https://github.com/jgm/commonmark.js>
2015-01-24 11:07:01 -08:00
John MacFarlane
c360bb0e17 Added new fine-grained JS benchmarks.
And a script to run them.
2015-01-17 21:01:39 -08:00
John MacFarlane
aedb6ca8cf Fixed template path in tools/makespec.py. 2015-01-15 16:14:15 -08:00
John MacFarlane
c74b87f9bb Fixed (interact) link in template.html.
This broke when we switched from pandoc to cmark for the spec,
because the class on code changed from 'markdown' to
'language-markdown'.
2015-01-15 16:10:59 -08:00
John MacFarlane
75007b20b4 Re-added tools/{makespec.py, template.html, template.tex}.
These were inadvertently dropped in the commit that described
them as being moved to tools/.
2015-01-15 16:08:03 -08:00
John MacFarlane
92ace5f0d4 Moved spec2js.js to tools/. 2015-01-12 20:43:55 -08:00
John MacFarlane
fed6a57f30 Moved templates, makespec.py, and specfilter.hs -> tools/. 2015-01-12 20:42:30 -08:00
John MacFarlane
6740322cc4 Moved mkcasefold.pl to tools/. 2015-01-12 20:34:47 -08:00