commit 721a55a9e57cebcde535bfaa77e3bbaae956d55b from: Omar Polo date: Mon Jan 17 10:05:04 2022 UTC handle non-closed verbatim blocks and nil-ify empty labels The idea behind the ``` marker is to toggle the preformatted bit on and off, so it's not strictly speaking a "verbatim block", even if it's easier to manage it that way. However, don't throw generic errors like that, and handle EOF without a closing ``` marker. While here, if label is the empty string, use nil. commit - 385d8c27124fbdf6686d98559ae01dc9c6a8acd0 commit + 721a55a9e57cebcde535bfaa77e3bbaae956d55b blob - 89f55326edea41032c0eee14bd565226cf770ab9 blob + 124e85332fac9df40785f67e29e174aea69cc734 --- gemtext.lisp +++ gemtext.lisp @@ -92,11 +92,11 @@ Can be a programming language name or alternative text (loop with label = (subseq line 3) with content = nil for line = (read-line in nil) - unless line - do (error "non-closed verbatim") - when (markerp line) + when (or (not line) + (markerp line)) return (make-instance 'verbatim - :alt label + :alt (unless (string-equal label "") + label) :text (format nil "~{~A~%~^~}" (nreverse content))) do (push line content))