1
0
Fork 0

- [gemini] fixed parsing of quoted lines, an empty line can be part of the quote.

This commit is contained in:
cage 2021-05-09 17:01:51 +02:00
parent 5f8c20ce7d
commit 5201953a08
2 changed files with 13 additions and 7 deletions

View File

@ -119,7 +119,7 @@ color-regexp = "➶ .+" magenta bold
# header level 1
color-regexp = "🞂 .+" white bold
color-regexp = "^🞂.*" white bold
# header level 2

View File

@ -165,10 +165,12 @@
(list (coerce (second a) 'string))))))
(defrule quote-line (and quote-prefix
text-line)
(? text-line))
(:function (lambda (a) (list (first a)
nil
(tag-value (second a))))))
(if (second a)
(tag-value (second a))
"")))))
(defrule gemini-file (* (or h3
h2
@ -467,11 +469,15 @@
(format nil "~a~a~%" (link-prefix-gemini theme) link-name)
(format nil "~a~a~%" (link-prefix-other theme) link-name)))
(fit-quote-lines (line win-width)
(let* ((justified (flush-left-mono-text (split-words line)
(let* ((words (split-words line))
(quote-prefix (quote-prefix theme))
(justified (flush-left-mono-text words
(- win-width
(length (quote-prefix theme)))))
(lines (mapcar (lambda (a) (strcat (quote-prefix theme) a))
justified)))
(length quote-prefix))))
(lines (if justified
(mapcar (lambda (a) (strcat quote-prefix a))
justified)
quote-prefix)))
(make-quoted-lines (join-with-strings lines (format nil "~%")))))
(pre-alt-text (node)
(trim (html-utils:attribute-value (html-utils:find-attribute :alt node))))