width defined by `elpher-gemini-max-fill-width'."
(string-match
(rx (: line-start
- (* (any " \t"))
(optional
(group (or (: "*" (+ (any " \t")))
(: ">" (* (any " \t"))))))))
(propertize text-line 'face 'elpher-gemini-quoted))
(t text-line))
text-line))
- (adaptive-fill-mode t)
- ;; fill-prefix is important for adaptive-fill-mode: without
- ;; it, multi-line list items are not indented correct
- (fill-prefix (if (match-string 1 text-line)
+ (fill-prefix (if line-prefix
(make-string (length (match-string 0 text-line)) ?\s)
nil)))
(insert (elpher-process-text-for-display processed-text-line))
(defun elpher-render-gemini-map (data _parameters)
"Render DATA as a gemini map file, PARAMETERS is currently unused."
(elpher-with-clean-buffer
- (let ((preformatted nil))
- (auto-fill-mode 1)
+ (auto-fill-mode 1)
+ (let ((preformatted nil)
+ (adaptive-fill-mode nil)) ;Prevent automatic setting of fill-prefix
(setq-local fill-column (min (window-width) elpher-gemini-max-fill-width))
(dolist (line (split-string data "\n"))
(cond