unofficial mirror of
 help / color / mirror / code / Atom feed
From: Mingkai Dong <>
Cc: Mingkai Dong <>
Subject: [PATCH] lisp/ox-html.el: Move the space after exported section number
Date: Mon,  3 May 2021 23:07:45 +0800	[thread overview]
Message-ID: <> (raw)

* ox-html.el (org-html-headline, org-html-format-headline-default-function):
delete the space after the section number span format and add it back in

The requirement is well described in the reddit post
which can be solved by setting the org-html-format-headline-function
variable to a custom function that adds the "." before the section title.
However, this results in something like "1 . Fist-Section-Title", rather
than "1. First-Section-Title", because of the extra space after the <span>
format. Moving the space to org-html-format-headline-default-function preserves
existing export behavior while allowing the users to better control the format.
 lisp/ox-html.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 89da823e8..f2ce71f68 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2676,7 +2676,7 @@ holding contextual information."
                            (and numberedp
-                                 "<span class=\"section-number-%d\">%s</span> "
+                                 "<span class=\"section-number-%d\">%s</span>"
                                  (mapconcat #'number-to-string numbers ".")))
@@ -2696,7 +2696,8 @@ See `org-html-format-headline-function' for details."
   (let ((todo (org-html--todo todo info))
 	(priority (org-html--priority priority info))
 	(tags (org-html--tags tags info)))
-    (concat todo (and todo " ")
+    (concat " "
+	    todo (and todo " ")
 	    priority (and priority " ")
 	    (and tags "&#xa0;&#xa0;&#xa0;") tags)))

             reply	other threads:[~2021-05-03 15:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 15:07 Mingkai Dong [this message]
2021-05-03 15:31 ` Bastien
2021-05-03 16:35   ` Mingkai Dong
2021-05-03 17:19     ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \
    --subject='Re: [PATCH] lisp/ox-html.el: Move the space after exported section number' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

unofficial mirror of

This inbox may be cloned and mirrored by anyone:

	git clone --mirror orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ \
	public-inbox-index orgmode

Example config snippet for mirrors.
Newsgroups are available over NNTP:

code repositories for project(s) associated with this inbox:

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git