Do not propertize newline in Gemini headings patch_no-propertize-gemini-heading-newline
authorProtesilaos Stavrou <info@protesilaos.com>
Fri, 30 Jul 2021 20:08:52 +0000 (23:08 +0300)
committerProtesilaos Stavrou <info@protesilaos.com>
Fri, 30 Jul 2021 20:08:52 +0000 (23:08 +0300)
The problem with the old design is noticeable when the heading's face
has a background, overline, or underline attribute.  That will appear on
the new line below the heading.

You can reproduce the problem by evaluating the following form and
visiting a page with headings:

    (set-face-attribute 'elpher-gemini-heading1 nil :background "gray50" :overline t)

elpher.el

index a82d1ba..3645f72 100644 (file)
--- a/elpher.el
+++ b/elpher.el
@@ -1510,8 +1510,7 @@ by HEADER-LINE."
                                                elpher--gemini-page-headings))
       (unless (display-graphic-p)
         (insert (make-string level ?#) " "))
-      (insert (propertize header 'face face))
-      (newline))))
+      (insert (format "%s\n" (propertize header 'face face))))))
 
 (defun elpher-gemini-insert-text (text-line)
   "Insert a plain non-preformatted TEXT-LINE into a text/gemini document.