Commits

Anonymous committed 0e049d7

Improve handling of inline HTML comments to comply with test suite

Comments (0)

Files changed (1)

 
 (define (tabs->spaces str)
   (irregex-replace/all
-   '(seq (submatch (* (~ #\tab))) #\tab)
+   '(seq (submatch (* (~ #\tab #\newline))) #\tab)
    str
    (lambda (m)
      (let* ((prefix (irregex-match-substring m 1))
                          (zero-or-more)
                          (as-string)))
               (_ (char-seq "-->")))
-    (result `(comment ,text))))
+    (result `(comment ,(tabs->spaces text)))))
 
 ;; HtmlBlockSelfClosing = '<' Spnl HtmlBlockType Spnl HtmlAttribute* '/' Spnl '>'
 
     (html-element . ,(lambda (_ contents)
                        contents))
     (comment . ,(lambda (_ contents)
-                  (list #\< "!--" contents "--" #\>)))
+                  (list #\< "!--" contents "--" #\> #\newline)))
     . ,alist-conv-rules*))
 
 (define (ref->alist-entry ref)