for the root element when appropriate.
TINYCHANGE
---
lisp/ox-html.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index facd84c..10891ce 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1912,9 +1912,13 @@ contents as a string, or nil if it is empty."
(mapcar (lambda (headline)
(cons (org-html--format-toc-headline headline info)
(org-export-get-relative-level headline info)))
- (org-export-collect-headlines info depth))))
+ (org-export-collect-headlines info depth)))
+ (outer-tag (if (and (org-html-html5-p info)
+ (plist-get info :html-html5-fancy))
+ "nav"
+ "div")))
(when toc-entries
- (concat "
\n"
+ (concat (format "<%s id=\"table-of-contents\">\n" outer-tag)
(format "
%s\n"
org-html-toplevel-hlevel
(org-html--translate "Table of Contents" info)
@@ -1922,7 +1926,7 @@ contents as a string, or nil if it is empty."
"
"
(org-html--toc-text toc-entries)
"
\n"
- "
\n"))))
+ (format "%s>\n" outer-tag)))))
(defun org-html--toc-text (toc-entries)
"Return innards of a table of contents, as a string.
--
1.8.1.2