Skip to content

Instantly share code, notes, and snippets.

@takaxp
Created July 29, 2019 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takaxp/0c928d6f25484bb7a1f02df27a2e04bc to your computer and use it in GitHub Desktop.
Save takaxp/0c928d6f25484bb7a1f02df27a2e04bc to your computer and use it in GitHub Desktop.
To avid unexpected code formatting in exported HTML file
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 757006321..c8fa3fda4 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment