all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* superfluous <code> tags in html src block output
@ 2019-09-14 15:52 Matt Price
  2019-09-14 17:53 ` Berry, Charles
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Price @ 2019-09-14 15:52 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 1682 bytes --]

I'm seeing something I hadn't noticed before in src block html exports.
Instead of producing structures like:

<pre>
<code>
<span>...</span>
<span>...</span>
<span>...</span>
</code>
</pre>

each individual like is wrapped in its own <code> tag.  In regular HTML
exports this doesn't really affect display, but in exports to reveal using
the highlight.js plugin, code display gets messed up.

From what I can tell these code tags are generated in
org-html-do-format-code, in this section which starts on line 22459 of my
pretty recent org:

(org-export-format-code
     code
     (lambda (loc line-num ref)
       (setq loc
    (concat
     ;; Add line number, if needed.
     (when num-start
(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)
     ;; Add label, if needed.
     (when (and ref retain-labels) (format " (%s)" ref))))
       ;; Mark transcoded line as an anchor, if needed.
       (if (not ref) loc
(format "<span id=\"coderef-%s\" class=\"coderef-off\">%s</span>"
ref loc)))
     num-start refs)

This code seems to have been around for a while so I don't know whether
this is new behaviour, but I don't think I've seen line-level <code> tags
before.  Can anyone confirm?

See also a MWE in this bug report, which is probably erroneously filed in
the org-re-reveal repo:

https://gitlab.com/oer/org-re-reveal/issues/27

I'd love to know whether this is expected behaviour, or if I've gone wrong
somewhere!
THanks,
Matt

[-- Attachment #2: Type: text/html, Size: 2494 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-14 19:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-14 15:52 superfluous <code> tags in html src block output Matt Price
2019-09-14 17:53 ` Berry, Charles
2019-09-14 19:56   ` Matt Price

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.