>From ba3130deb9dbbab3c7d293f901ff08be839a8a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Lechtenb=C3=B6rger?= Date: Sat, 21 Sep 2019 12:01:59 +0200 Subject: [PATCH] ox-html: Control source line wrapping * list/ox-html.el (org-html-do-format-code): Use new variable org-html-wrap-src-lines to control whether source code lines should be wrapped in code elements or not. Allow to revert to behavior before commit ded3d27b1468b878197e5fe55a70c5e13350ea27. --- lisp/ox-html.el | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 757006321..969e649fc 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -932,6 +932,14 @@ in all modes you want. Then, use the command :group 'org-export-html :type 'string) +(defcustom org-html-wrap-src-lines t + "If t, wrap individual lines of source blocks in \"code\" elements. +In this case, add line number in attribute \"data-ox-html-linenr\" when line +numbers are enabled." + :group 'org-export-html + :package-version '(Org . "9.3") + :type 'boolean) + ;;;; Table (defcustom org-html-table-default-attributes @@ -2256,11 +2264,13 @@ line of code." (format "%s" (format num-fmt line-num))) ;; Transcoded src line. - (format "%s" - (if num-start - (format " data-ox-html-linenr=\"%s\"" line-num) - "") - loc) + (if org-html-wrap-src-lines + (format "%s" + (if num-start + (format " data-ox-html-linenr=\"%s\"" line-num) + "") + loc) + loc) ;; Add label, if needed. (when (and ref retain-labels) (format " (%s)" ref)))) ;; Mark transcoded line as an anchor, if needed. -- 2.20.1