From 75d833949ccb20edbcaaf4e24d278adec0cc125b Mon Sep 17 00:00:00 2001 From: w6vvn Date: Mon, 1 Sep 2025 20:34:59 -0700 Subject: [PATCH] correct a logical error that would lead to merging unrelated preformatted blocks --- gem300.rkt | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/gem300.rkt b/gem300.rkt index d7ca0d5..b39cbe9 100644 --- a/gem300.rkt +++ b/gem300.rkt @@ -41,20 +41,15 @@ ;; add line to most recent preformat block [(symbol=? 'preformatted state) - (if (preformatted? (car document)) - ;; little bit hard to follow: take the existing - ;; preformatted blocks content, cons the new line; - ;; then, cons the new preformatted block to the cdr of - ;; the document - (iter (cons (preformatted (cons (car lines) - (preformatted-str (car document)))) - (cdr document)) - (cdr lines) - 'preformatted) - - (iter (cons (preformatted (list)) document) - (cdr lines) - 'preformatted))] + ;; little bit hard to follow: take the existing + ;; preformatted blocks content, cons the new line; + ;; then, cons the new preformatted block to the cdr of + ;; the document + (iter (cons (preformatted (cons (car lines) + (preformatted-str (car document)))) + (cdr document)) + (cdr lines) + 'preformatted)] ;; rest of this is normal mode @@ -68,7 +63,7 @@ ;; preformatting toggle lines [(string-prefix? (car lines) "```") ;; add preformatted block to document and toggle mode - (iter document + (iter (cons (preformatted (list)) document) (cdr lines) 'preformatted)]