emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Austin Walker <awalk89@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix TODO export in html TOC
Date: Wed, 17 Feb 2016 23:22:00 -0500	[thread overview]
Message-ID: <CAO52wqVoP3HEf1G5OJkiP3ZufOkwmKkHA+KLSi7SqiKvRaNHxg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]

Hello all,

I'd like to submit a fix for an issue seen by reddit user simonced.
https://www.reddit.com/r/emacs/comments/46717x/orgmode_todo_html_export_in_toc/

When exporting a TODO headline to html, the TOC will show the class to be
"todo nilTODO". The fix is to replace nil with an empty string. I'm new to
the org-mode mailing list, so please let me know if I made a mistake.
Thanks!

From e456d1722f983baa11a38e944be279f4d21f588b Mon Sep 17 00:00:00 2001
From: Austin Walker <awalk89@gmail.com>
Date: Wed, 17 Feb 2016 22:43:00 -0500
Subject: [PATCH] ox-html.el: Fix TOC export of TODO headlines

* lisp/ox-html.el (org-html--todo): Don't show nil in format string for
  TODO class

Use empty string if :html-todo-kwd-class-prefix is not present.

TINYCHANGE
---
 lisp/ox-html.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 697e5aa..2d7acec 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1989,7 +1989,7 @@ INFO is a plist used as a communication channel."
   (when todo
     (format "<span class=\"%s %s%s\">%s</span>"
         (if (member todo org-done-keywords) "done" "todo")
-        (plist-get info :html-todo-kwd-class-prefix)
+        (or (plist-get info :html-todo-kwd-class-prefix) "")
         (org-html-fix-class-name todo)
         todo)))

-- 
2.7.1

- Austin Walker

[-- Attachment #2: Type: text/html, Size: 1853 bytes --]

             reply	other threads:[~2016-02-18  4:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18  4:22 Austin Walker [this message]
2016-02-19 13:31 ` [PATCH] Fix TODO export in html TOC Nicolas Goaziou

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=CAO52wqVoP3HEf1G5OJkiP3ZufOkwmKkHA+KLSi7SqiKvRaNHxg@mail.gmail.com \
    --to=awalk89@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).