correct a logical error that would lead to merging unrelated preformatted blocks

This commit is contained in:
2025-09-01 20:34:59 -07:00
parent 1fab00d3a2
commit 75d833949c

View File

@@ -41,20 +41,15 @@
;; add line to most recent preformat block ;; add line to most recent preformat block
[(symbol=? 'preformatted state) [(symbol=? 'preformatted state)
(if (preformatted? (car document)) ;; little bit hard to follow: take the existing
;; little bit hard to follow: take the existing ;; preformatted blocks content, cons the new line;
;; preformatted blocks content, cons the new line; ;; then, cons the new preformatted block to the cdr of
;; then, cons the new preformatted block to the cdr of ;; the document
;; the document (iter (cons (preformatted (cons (car lines)
(iter (cons (preformatted (cons (car lines) (preformatted-str (car document))))
(preformatted-str (car document)))) (cdr document))
(cdr document)) (cdr lines)
(cdr lines) 'preformatted)]
'preformatted)
(iter (cons (preformatted (list)) document)
(cdr lines)
'preformatted))]
;; rest of this is normal mode ;; rest of this is normal mode
@@ -68,7 +63,7 @@
;; preformatting toggle lines ;; preformatting toggle lines
[(string-prefix? (car lines) "```") [(string-prefix? (car lines) "```")
;; add preformatted block to document and toggle mode ;; add preformatted block to document and toggle mode
(iter document (iter (cons (preformatted (list)) document)
(cdr lines) (cdr lines)
'preformatted)] 'preformatted)]