emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix TODO export in html TOC
@ 2016-02-18  4:22 Austin Walker
  2016-02-19 13:31 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Austin Walker @ 2016-02-18  4:22 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix TODO export in html TOC
  2016-02-18  4:22 [PATCH] Fix TODO export in html TOC Austin Walker
@ 2016-02-19 13:31 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2016-02-19 13:31 UTC (permalink / raw)
  To: Austin Walker; +Cc: emacs-orgmode

Hello,

Austin Walker <awalk89@gmail.com> writes:

> 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.

You didn't. I applied it. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-19 13:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-18  4:22 [PATCH] Fix TODO export in html TOC Austin Walker
2016-02-19 13:31 ` Nicolas Goaziou

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).