Commits

Moritz Heidkamp committed 5019f71

Fix inline style in headings

Thanks to Alex Charlton for reporting the issue.

Comments (0)

Files changed (7)

 (define atx-heading
   (sequence* ((level atx-start)
               (_ space*)
-              (text (as-string (one-or-more atx-inline)))
+              (text (one-or-more atx-inline))
               (_ (maybe (preceded-by space* (zero-or-more (is #\#)) space*)))
               (_ new-line))
     (result `(heading ,level ,text))))
 
 (define (setext-heading* level bottom-char)
   (let ((bottom (setext-bottom bottom-char)))
-    (sequence* ((text (-> (none-of* line-end inline)
-                          (one-or-more)
-                          (as-string)))
+    (sequence* ((text (one-or-more (none-of* line-end inline)))
                 (_ (preceded-by space* new-line bottom)))
       (result `(heading ,level ,text)))))
 

tests/MarkdownTest_1.0.3/Tests/Headings, inline style.html

+<h1>Hello <em>world</em>, how are you?</h1>
+
+<h2>I am <strong>fine</strong>, thanks</h2>
+
+<h1>Hello <em>world</em>, how are you?</h1>
+
+<h2>I am <strong>fine</strong>, thanks</h2>

tests/MarkdownTest_1.0.3/Tests/Headings, inline style.text

+# Hello *world*, how are you?
+
+## I am **fine**, thanks
+
+Hello *world*, how are you?
+===========================
+
+I am **fine**, thanks
+---------------------

tests/MarkdownTest_1.0.3/Tests/Headings, setext at eof.html

+<h1>Foo</h1>

tests/MarkdownTest_1.0.3/Tests/Headings, setext at eof.text

+Foo
+===

tests/MarkdownTest_1.0.3/Tests/Setext heading at eof.html

-<h1>Foo</h1>

tests/MarkdownTest_1.0.3/Tests/Setext heading at eof.text

-Foo
-===