1
0
Fork 0

- [gemini/parsing] transformed to vertical space a text line made from blank characters only.

This commit is contained in:
cage 2021-10-26 20:05:12 +02:00
parent 02a277894a
commit fe9792a576
1 changed files with 9 additions and 5 deletions

View File

@ -562,13 +562,15 @@
:bgcolor (link-bg theme)))) :bgcolor (link-bg theme))))
(pre-alt-text (node) (pre-alt-text (node)
(trim (html-utils:attribute-value (html-utils:find-attribute :alt node)))) (trim (html-utils:attribute-value (html-utils:find-attribute :alt node))))
(make-vertical-space ()
(make-instance 'vertical-space
:group-id (current-header-group-id)))
(build-rows () (build-rows ()
(loop for node in parsed-gemini (loop for node in parsed-gemini
collect collect
(cond (cond
((null node) ((null node)
(make-instance 'vertical-space (make-vertical-space))
:group-id (current-header-group-id))) ;(format nil "~%"))
((html-utils:tag= :as-is node) ((html-utils:tag= :as-is node)
(let* ((line (text-value node :trim nil)) (let* ((line (text-value node :trim nil))
(fg (preformatted-fg theme)) (fg (preformatted-fg theme))
@ -579,9 +581,11 @@
(current-pre-group-id) (current-pre-group-id)
(current-pre-alt-text)))) (current-pre-alt-text))))
((html-utils:tag= :text node) ((html-utils:tag= :text node)
(let ((text (text-value node))) (let ((text (text-value node :trim t)))
(if (string-not-empty-p text)
(make-simple-line (format nil "~a~%" text) (make-simple-line (format nil "~a~%" text)
(current-header-group-id)))) (current-header-group-id))
(make-vertical-space))))
((html-utils:tag= :h1 node) ((html-utils:tag= :h1 node)
(make-header 1 (make-header 1
(header-prefix-h1 (text-value node)) (header-prefix-h1 (text-value node))