diff options
author | thibault <thibault.marin@gmx.com> | 2017-12-03 17:42:13 -0600 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-12-04 08:24:02 +0100 |
commit | e22ee8b8a39933c8d662894a3b96b07337c4f536 (patch) | |
tree | e089d852b5a082c13bbabc0bdd75bb27c072ed31 | |
parent | 037db00f40b6b00c05f32e13fd5bf61f2d1b04cc (diff) | |
download | org-mode-e22ee8b8a39933c8d662894a3b96b07337c4f536.tar.gz |
Fix bug in HTML export of code blocks with starting blank lines
* lisp/ox-html.el (org-html-do-format-code): Preverse starting blank
lines when splitting code lines (use `split-string' instead of
`org-split-string').
(org-html-fontify-code): Preserve starting blank lines in returned
code string.
-rw-r--r-- | lisp/ox-html.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 5288797..bf08de1 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2202,7 +2202,7 @@ https://github.com/hniksic/emacs-htmlize")) (org-html-htmlize-region-for-paste (point-min) (point-max)))))) ;; Strip any enclosing <pre></pre> tags. - (let* ((beg (and (string-match "\\`<pre[^>]*>\n*" code) (match-end 0))) + (let* ((beg (and (string-match "\\`<pre[^>]*>\n?" code) (match-end 0))) (end (and beg (string-match "</pre>\\'" code)))) (if (and beg end) (substring code beg end) code))))))))) @@ -2215,7 +2215,7 @@ alist between line numbers and references (as returned by `org-export-unravel-code'), a boolean specifying if labels should appear in the source code, and the number associated to the first line of code." - (let* ((code-lines (org-split-string code "\n")) + (let* ((code-lines (split-string code "\n")) (code-length (length code-lines)) (num-fmt (and num-start |