why not para-breaks in markdown?

main
Matthew Butterick 6 years ago
parent 0006c02a10
commit 1dfaa5e7c0

@ -203,6 +203,7 @@
(define hung-word-sublists
(match word-sublists
[(list sublists ... (list prev-qs ... last-q))
#:when (pair? (quad-elems last-q))
(define last-char-str (regexp-match #rx"[.,:;-]$" (car (quad-elems last-q))))
(match last-char-str
[#false word-sublists]
@ -213,7 +214,8 @@
(match-define (list x y) (force p))
(pt (- x) y)))]))
(define last-sublist (append prev-qs (list last-q hanger-q)))
(append sublists (list last-sublist))])]))
(append sublists (list last-sublist))])]
[_ word-sublists]))
(define word-width (sum-of-widths hung-word-sublists))
(define word-space-width (sum-of-widths word-space-sublists))
(define empty-hspace (- line-width

@ -23,9 +23,9 @@
;; markdown parser returns list of paragraphs
(root null (match strs
[(list str) strs]
[_ (add-between strs (list para-break)
#:before-first (list para-break)
#:after-last (list para-break)
[_ (add-between strs (list q:para-break)
#:before-first (list q:para-break)
#:after-last (list q:para-break)
#:splice? #true)])))
(make-module-begin doc-proc)

Loading…
Cancel
Save