diff --git a/api_test/main.c b/api_test/main.c index 1a41e694a..790327c62 100644 --- a/api_test/main.c +++ b/api_test/main.c @@ -942,6 +942,13 @@ static void test_feed_across_line_ending(test_batch_runner *runner) { # include static struct timeval _before, _after; static int _timing; +static int _timing_scale = 1; +# define SETUP_TIMING() \ + do { \ + char *scale = getenv("CMARK_TIMING_SCALE"); \ + if (scale) \ + _timing_scale = atoi(scale); \ + } while (0) # define START_TIMING() \ gettimeofday(&_before, NULL) @@ -952,10 +959,13 @@ static int _timing; } while (0) # define TIMING _timing +# define TIMING_SCALE _timing_scale #else +# define SETUP_TIMING() # define START_TIMING() # define END_TIMING() # define TIMING 0 +# define TIMING_SCALE 1 #endif static void test_pathological_regressions(test_batch_runner *runner) { @@ -973,7 +983,8 @@ static void test_pathological_regressions(test_batch_runner *runner) { free(html); free(input); - OK(runner, TIMING < 1000, "takes less than 1000ms to run"); + OK(runner, TIMING < 1000 * TIMING_SCALE, + "takes less than CMARK_TIMING_SCALE * 1000ms to run"); } { @@ -989,7 +1000,8 @@ static void test_pathological_regressions(test_batch_runner *runner) { free(html); free(input); - OK(runner, TIMING < 1000, "takes less than 1000ms to run"); + OK(runner, TIMING < 1000 * TIMING_SCALE, + "takes less than CMARK_TIMING_SCALE * 1000ms to run"); } } @@ -1133,6 +1145,7 @@ int main() { int retval; test_batch_runner *runner = test_batch_runner_new(); + SETUP_TIMING(); cmark_enable_safety_checks(true); version(runner); constructor(runner); diff --git a/man/man1/cmark-gfm.1 b/man/man1/cmark-gfm.1 index 4fca62732..c25791c33 100644 --- a/man/man1/cmark-gfm.1 +++ b/man/man1/cmark-gfm.1 @@ -66,6 +66,18 @@ URLs are those that begin with `javascript:`, `vbscript:`, `file:`, or `data:` (except for `image/png`, `image/gif`, `image/jpeg`, or `image/webp` mime types). .TP 12n +.B \-\-github-pre-lang +Use GitHub-style
 for code blocks.
+.TP 12n
+.B \-\-strikethrough-double-tilde
+Only parse strikethrough (if enabled) with two tildes.
+.TP 12n
+.B \-\-table-prefer-style-attributes
+Use style attributes to align table cells instead of align attributes.
+.TP 12n
+.B \-\-full-info-string
+Include remainder of code block info string in a separate attribute.
+.TP 12n
 .B \-\-help
 Print usage information.
 .TP 12n
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 84dd2a037..6a67078f1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -175,6 +175,10 @@ if(CMARK_SHARED OR CMARK_STATIC)
     DESTINATION include
     )
 
+  install(FILES ${HEADERS}
+    DESTINATION include/cmark-gfm
+    )
+
   install(EXPORT cmark-gfm DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
 endif()
 
diff --git a/test/normalize.py b/test/normalize.py
index b7fd9b245..ec4979c0b 100644
--- a/test/normalize.py
+++ b/test/normalize.py
@@ -18,7 +18,7 @@ class HTMLParseError(Exception):
 # Normalization code, adapted from
 # https://github.com/karlcow/markdown-testsuite/
 significant_attrs = ["alt", "href", "src", "title"]
-whitespace_re = re.compile('\s+')
+whitespace_re = re.compile('\\s+')
 class MyHTMLParser(HTMLParser):
     def __init__(self):
         HTMLParser.__init__(self)
@@ -176,7 +176,7 @@ def normalize_html(html):
         '\u2200&><"'
 
     """
-    html_chunk_re = re.compile("(\|\<[^>]*\>|[^<]+)")
+    html_chunk_re = re.compile("(\\|\\<[^>]*\\>|[^<]+)")
     try:
         parser = MyHTMLParser()
         # We work around HTMLParser's limitations parsing CDATA
diff --git a/test/pathological_tests.py b/test/pathological_tests.py
index d0e910c5e..c2fdff64d 100644
--- a/test/pathological_tests.py
+++ b/test/pathological_tests.py
@@ -7,6 +7,7 @@
 import platform
 import itertools
 import multiprocessing
+import os
 from cmark import CMark
 
 def hash_collisions():
@@ -29,7 +30,7 @@ def badhash(ref):
 
     document = ''.join("[%s]: /url\n\n[%s]\n\n" % (key, bad_key) for key in collisions)
 
-    return document, re.compile("(

\[%s\]

\n){%d}" % (bad_key, COUNT-1)) + return document, re.compile("(

\\[%s\\]

\n){%d}" % (bad_key, COUNT-1)) allowed_failures = {"many references": True} @@ -47,10 +48,10 @@ def badhash(ref): re.compile("(_a ){64999}_a")), "many link closers with no openers": (("a]" * 65000), - re.compile("(a\]){65000}")), + re.compile("(a\\]){65000}")), "many link openers with no closers": (("[a" * 65000), - re.compile("(\[a){65000}")), + re.compile("(\\[a){65000}")), "mismatched openers and closers": (("*a_ " * 50000), re.compile("([*]a[_] ){49999}[*]a_")), @@ -59,19 +60,19 @@ def badhash(ref): re.compile("a[*][*]b(c[*] ){49999}c[*]")), "link openers and emph closers": (("[ a_" * 50000), - re.compile("(\[ a_){50000}")), + re.compile("(\\[ a_){50000}")), "pattern [ (]( repeated": (("[ (](" * 80000), - re.compile("(\[ \(\]\(){80000}")), + re.compile("(\\[ \\(\\]\\(){80000}")), "pattern ![[]() repeated": ("![[]()" * 160000, - re.compile("(!\[){160000}")), + re.compile("(!\\[){160000}")), "hard link/emph case": ("**x [a*b**c*](d)", re.compile("\\*\\*x ab\\*\\*c")), "nested brackets": (("[" * 50000) + "a" + ("]" * 50000), - re.compile("\[{50000}a\]{50000}")), + re.compile("\\[{50000}a\\]{50000}")), "nested block quotes": ((("> " * 50000) + "a"), re.compile("(
\n){50000}")), @@ -86,13 +87,13 @@ def badhash(ref): re.compile("^

[e`]*

\n$")), "unclosed links A": ("[a](aaa

\n\n\n\n\n\n\n\n(\n\n\n\n\n\n\n\n\n){29999}\n
bbb
aaa
bbb
-\x0b
\n$")), @@ -106,7 +107,8 @@ def badhash(ref): passed = 0 errored = 0 ignored = 0 -TIMEOUT = 5 +timing_scale = float(os.getenv("CMARK_TIMING_SCALE", "1")) +TIMEOUT = 5 * timing_scale def run_test(inp, regex): parser = argparse.ArgumentParser(description='Run cmark tests.') @@ -144,12 +146,12 @@ def run_test(inp, regex): p.terminate() p.join() print('[TIMED OUT]') - if allowed_failures[description]: + if description in allowed_failures: ignored += 1 else: errored += 1 elif p.exitcode != 0: - if allowed_failures[description]: + if description in allowed_failures: ignored += 1 else: errored += 1