cmark

My personal build of CMark ✏️

Commit
7030f3a97cf0777e320e22bf030caa66395d09a6
Parent
4d84b1f573bdb896e5473f7d6b289c937f8bf1d2
Author
John MacFarlane <jgm@berkeley.edu>
Date

Merge pull request #245 from cirosantilli/normalize-whitespace-fail

Expose failure to normalize whitespaces

Diffstat

2 files changed, 7 insertions, 2 deletions

Status File Name N° Changes Insertions Deletions
Modified .travis.yml 1 1 0
Modified test/normalize.py 8 6 2
diff --git a/.travis.yml b/.travis.yml
@@ -8,3 +8,4 @@ before_install:
 script:
  - make testtarball
  - PROG=`ls cmark-*.*/build/src/cmark` make leakcheck
+ - python -m doctest test/normalize.py
diff --git a/test/normalize.py b/test/normalize.py
@@ -115,8 +115,12 @@ def normalize_html(html):
     Return normalized form of HTML which ignores insignificant output
     differences:
 
-    * Multiple inner whitespaces are collapsed to a single space (except
-      in pre tags).
+    Multiple inner whitespaces are collapsed to a single space (except
+    in pre tags):
+
+        >>> normalize_html("<p>a  \t\nb</p>")
+        u'<p>a b</p>'
+
     * Outer whitespace (outside block-level tags) is removed.
     * Self-closing tags are converted to open tags.
     * Attributes are sorted and lowercased.