mirror of https://codeberg.org/cage/tinmop/
- [gemini] fixed parsing of quoted lines, an empty line can be part of the quote.
This commit is contained in:
parent
5f8c20ce7d
commit
5201953a08
|
@ -119,7 +119,7 @@ color-regexp = "➶ .+" magenta bold
|
||||||
|
|
||||||
# header level 1
|
# header level 1
|
||||||
|
|
||||||
color-regexp = "🞂 .+" white bold
|
color-regexp = "^🞂.*" white bold
|
||||||
|
|
||||||
# header level 2
|
# header level 2
|
||||||
|
|
||||||
|
|
|
@ -165,10 +165,12 @@
|
||||||
(list (coerce (second a) 'string))))))
|
(list (coerce (second a) 'string))))))
|
||||||
|
|
||||||
(defrule quote-line (and quote-prefix
|
(defrule quote-line (and quote-prefix
|
||||||
text-line)
|
(? text-line))
|
||||||
(:function (lambda (a) (list (first a)
|
(:function (lambda (a) (list (first a)
|
||||||
nil
|
nil
|
||||||
(tag-value (second a))))))
|
(if (second a)
|
||||||
|
(tag-value (second a))
|
||||||
|
"")))))
|
||||||
|
|
||||||
(defrule gemini-file (* (or h3
|
(defrule gemini-file (* (or h3
|
||||||
h2
|
h2
|
||||||
|
@ -467,11 +469,15 @@
|
||||||
(format nil "~a~a~%" (link-prefix-gemini theme) link-name)
|
(format nil "~a~a~%" (link-prefix-gemini theme) link-name)
|
||||||
(format nil "~a~a~%" (link-prefix-other theme) link-name)))
|
(format nil "~a~a~%" (link-prefix-other theme) link-name)))
|
||||||
(fit-quote-lines (line win-width)
|
(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
|
(- win-width
|
||||||
(length (quote-prefix theme)))))
|
(length quote-prefix))))
|
||||||
(lines (mapcar (lambda (a) (strcat (quote-prefix theme) a))
|
(lines (if justified
|
||||||
justified)))
|
(mapcar (lambda (a) (strcat quote-prefix a))
|
||||||
|
justified)
|
||||||
|
quote-prefix)))
|
||||||
(make-quoted-lines (join-with-strings lines (format nil "~%")))))
|
(make-quoted-lines (join-with-strings lines (format nil "~%")))))
|
||||||
(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))))
|
||||||
|
|
Loading…
Reference in New Issue