From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: [ox-html, patch] More newlines around lists Date: Tue, 14 Feb 2017 12:32:34 +0100 Message-ID: <87a89pnh2l.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdbLl-0006kE-Fc for emacs-orgmode@gnu.org; Tue, 14 Feb 2017 06:32:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdbLi-0005Lo-9f for emacs-orgmode@gnu.org; Tue, 14 Feb 2017 06:32:49 -0500 Received: from [195.159.176.226] (port=49343 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdbLi-0005L9-22 for emacs-orgmode@gnu.org; Tue, 14 Feb 2017 06:32:46 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cdbLZ-0005LL-Lx for emacs-orgmode@gnu.org; Tue, 14 Feb 2017 12:32:37 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi, This patch inserts more newlines around lists, and thus makes the source a bit more readable (IMO). It's an almost purely cosmetic change. Can I apply this or are the newlines left out on purpose? Rasmus -- Hvor meget poesi tror De kommer ud af et glas isvand? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ox-html-More-newlines-around-lists.patch >From f463b0f119c30b7ac89db2981df573bb26cf38f6 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Tue, 14 Feb 2017 12:03:16 +0100 Subject: [PATCH] ox-html: More newlines around lists * lisp/ox-html.el (org-html-headline): (org-html-format-list-item): (org-html-section): Insert more newlines. --- lisp/ox-html.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index bb29d4a35..231fd41fc 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2560,16 +2560,16 @@ holding contextual information." (let* ((html-type (if numberedp "ol" "ul"))) (concat (and (org-export-first-sibling-p headline info) - (apply 'format "<%s class=\"org-%s\">" + (apply 'format "<%s class=\"org-%s\">\n" (make-list 2 html-type))) (org-html-format-list-item contents (if numberedp 'ordered 'unordered) nil info nil (concat (org-html--anchor preferred-id nil nil info) extra-ids - full-text)) + full-text)) "\n" (and (org-export-last-sibling-p headline info) - (format "" html-type)))) + (format "\n" html-type)))) ;; Standard headline. Export it as a section. (let ((extra-class (org-element-property :HTML_CONTAINER_CLASS headline)) (first-content (car (org-element-contents headline)))) @@ -2696,7 +2696,8 @@ INFO is a plist holding contextual information. See (symbol-name checkbox)) "")) (checkbox (concat (org-html-checkbox checkbox info) (and checkbox " "))) - (br (org-html-close-tag "br" nil info))) + (br (org-html-close-tag "br" nil info)) + (extra-newline (if (and (org-string-nw-p contents) headline) "\n" ""))) (concat (pcase type (`ordered @@ -2719,7 +2720,9 @@ INFO is a plist holding contextual information. See class (concat checkbox term)) "
")))) (unless (eq type 'descriptive) checkbox) - (and contents (org-trim contents)) + extra-newline + (and (org-string-nw-p contents) (org-trim contents)) + extra-newline (pcase type (`ordered "") (`unordered "") @@ -3266,7 +3269,7 @@ holding contextual information." #'number-to-string (org-export-get-headline-number parent info) "-")))) ;; Build return value. - (format "
\n%s
" + (format "
\n%s
\n" class-num (or (org-element-property :CUSTOM_ID parent) section-number -- 2.11.1 --=-=-=--