Last active
September 24, 2019 16:25
-
-
Save takaxp/979f36cdb92891d75b37b3e185c98e0d to your computer and use it in GitHub Desktop.
A patch for ox-html to use CUTOM_IDs on id tags.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lisp/ox-html.el b/lisp/ox-html.el | |
index 757006321..0286317e5 100644 | |
--- a/lisp/ox-html.el | |
+++ b/lisp/ox-html.el | |
@@ -2256,11 +2256,10 @@ line of code." | |
(format "<span class=\"linenr\">%s</span>" | |
(format num-fmt line-num))) | |
;; Transcoded src line. | |
- (format "<code%s>%s</code>" | |
- (if num-start | |
- (format " data-ox-html-linenr=\"%s\"" line-num) | |
- "") | |
- loc) | |
+ (if num-start | |
+ (format "<code data-ox-html-linenr=\"%s\">%s</code>" | |
+ line-num loc) | |
+ loc) | |
;; Add label, if needed. | |
(when (and ref retain-labels) (format " (%s)" ref)))) | |
;; Mark transcoded line as an anchor, if needed. | |
@@ -2635,7 +2634,8 @@ holding contextual information." | |
(format "<%s id=\"%s\" class=\"%s\">%s%s</%s>\n" | |
(org-html--container headline info) | |
(concat "outline-container-" | |
- (org-export-get-reference headline info)) | |
+ (or (org-element-property :CUSTOM_ID headline) | |
+ (org-export-get-reference headline info))) | |
(concat (format "outline-%d" level) | |
(and extra-class " ") | |
extra-class) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment