From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thibault Marin Subject: Re: Possible bug with coderef highlighting in HTML export Date: Sun, 03 Dec 2017 18:41:42 -0600 Message-ID: <87y3mjtjcp.fsf@dell-desktop.WORKGROUP> References: <87lgikp099.fsf@dell-desktop.WORKGROUP> <877eu3dhtz.fsf@nicolasgoaziou.fr> Reply-To: thibault.marin@gmx.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLepT-00008z-R1 for emacs-orgmode@gnu.org; Sun, 03 Dec 2017 19:41:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLepQ-00038I-OQ for emacs-orgmode@gnu.org; Sun, 03 Dec 2017 19:41:51 -0500 Received: from mout.gmx.net ([212.227.15.19]:55734) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eLepQ-000386-DE for emacs-orgmode@gnu.org; Sun, 03 Dec 2017 19:41:48 -0500 In-reply-to: <877eu3dhtz.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: org mode --=-=-= Content-Type: text/plain Hi, Hi the attach patch fixes the issue for me. Please let me know if you have any suggestions. As always, thanks for the guidance. thibault --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-bug-in-HTML-export-of-code-blocks-with-starting-.patch >From a78dc91c9fd1aacb2c65f66ae5afa9ee25f56e01 Mon Sep 17 00:00:00 2001 From: thibault Date: Sun, 3 Dec 2017 17:42:13 -0600 Subject: [PATCH] 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. --- lisp/ox-html.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 0e22c1699..90a6cede0 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
 tags.
-	  (let* ((beg (and (string-match "\\`]*>\n*" code) (match-end 0)))
+	  (let* ((beg (and (string-match "\\`]*>\n?" code) (match-end 0)))
 		 (end (and beg (string-match "\\'" 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
-- 
2.14.1


--=-=-=--