summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/CMakeLists.txt1
-rw-r--r--test/roundtrip_tests.py11
2 files changed, 10 insertions, 2 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index dd850b6..3b23cff 100755
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -50,7 +50,6 @@ IF (PYTHONINTERP_FOUND)
${PYTHON_EXECUTABLE}
"${CMAKE_CURRENT_SOURCE_DIR}/roundtrip_tests.py"
"--spec" "${CMAKE_CURRENT_SOURCE_DIR}/spec.txt"
- "--no-normalize"
"--library-dir" "${CMAKE_CURRENT_BINARY_DIR}/../src"
)
diff --git a/test/roundtrip_tests.py b/test/roundtrip_tests.py
index 8becb08..a52aa8d 100644
--- a/test/roundtrip_tests.py
+++ b/test/roundtrip_tests.py
@@ -1,3 +1,4 @@
+import re
import sys
from spec_tests import get_tests, do_test
from cmark import CMark
@@ -26,7 +27,15 @@ def converter(md):
cmark = CMark(prog=args.program, library_dir=args.library_dir)
[ec, result, err] = cmark.to_commonmark(md)
if ec == 0:
- return cmark.to_html(result)
+ [ec, html, err] = cmark.to_html(result)
+ if ec == 0:
+ # In the commonmark writer we insert dummy HTML
+ # comments between lists, and between lists and code
+ # blocks. Strip these out, since the spec uses
+ # two blank lines instead:
+ return [ec, re.sub('<!-- end list -->\n', '', html), '']
+ else:
+ return [ec, html, err]
else:
return [ec, result, err]