Commits

Anonymous committed fa6a0da

MOAR passing tests

  • Participants
  • Parent commits 749c24e

Comments (0)

Files changed (1)

File lowdown-impl.scm

   (one-or-more space-char))
 
 (define new-line
-  (is #\newline))
+  (->> (preceded-by (is #\return) (maybe #\newline))
+       (any-of (is #\newline))))
 
 ;; Spnl
 (define space-new-line
 
 (define link-title
   (sequence* ((delimiter (satisfies (char-set #\' #\")))
-              (title (-> (none-of (is delimiter))
+              (title (-> (preceded-by
+                          (is delimiter)
+                          space*
+                          (any-of (is #\)) new-line))
+                         (none-of)
                          (preceded-by item)
                          (zero-or-more)
                          (as-string)))
            (followed-by line-end
                         inline-without-line-end))))
 
+;; RefTitleParens = Spnl '(' < ( !(')' Sp Newline | Newline) . )* > ')'
+
 (define reference-title
   (let ((delimiters '((#\( . #\)))))
-    (sequence* ((delimiter (preceded-by space-new-line
-                                        (satisfies (char-set  #\( #\' #\"))))
+    (sequence* ((delimiter (->> (satisfies (char-set #\( #\' #\"))
+                                (preceded-by space-new-line)))
                 (closing-delimiter (result (or (alist-ref delimiter delimiters) delimiter)))
-                (title (-> (none-of (is closing-delimiter))
+                (title (-> (preceded-by
+                            (is closing-delimiter)
+                            space*
+                            (any-of new-line end-of-input))
+                           (none-of new-line)
                            (preceded-by item)
                            (zero-or-more)
                            (as-string)))