Re: [O] superfluous tags in html src block output

2019-09-14 Thread Matt Price
On Sat, Sep 14, 2019 at 1:53 PM Berry, Charles  wrote:

> This is newer:
>
> ===
> commit ded3d27b1468b878197e5fe55a70c5e13350ea27
> Author: Nik Clayton 
> Date:   Tue Jun 4 11:57:40 2019 +0200
>
> ox-html: Wrap each line of a source block in a code element
>
> * lisp/ox-html.el (org-html-do-format-code): Wrap each line of a
> source block
> in a code element.
>
> This makes it straightforward to add custom decorations to each line
> using CSS :before and :after properties.
>
> ===
>
> ah, man, thank you, that's very helpful.   Clearly this is the issue. I'll
have to figure out the best way to make this work with the `highlight.js`
library that reveal.js depends on for code highlighting.

>
>
> HTH,
>
> Chuck
>
>
> > On Sep 14, 2019, at 8:52 AM, Matt Price  wrote:
> >
> > I'm seeing something I hadn't noticed before in src block html exports.
> Instead of producing structures like:
> >
> > 
> > 
> > ...
> > ...
> > ...
> > 
> > 
> >
> > each individual like is wrapped in its own  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 "%s"
> > (format num-fmt line-num)))
> >  ;; Transcoded src line.
> >  (format "%s"
> >   (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 "%s"
> > 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  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
> >
>
>
>


Re: [O] superfluous tags in html src block output

2019-09-14 Thread Berry, Charles
This is newer:

===
commit ded3d27b1468b878197e5fe55a70c5e13350ea27
Author: Nik Clayton 
Date:   Tue Jun 4 11:57:40 2019 +0200

ox-html: Wrap each line of a source block in a code element

* lisp/ox-html.el (org-html-do-format-code): Wrap each line of a source 
block
in a code element.

This makes it straightforward to add custom decorations to each line
using CSS :before and :after properties.

===



HTH,

Chuck


> On Sep 14, 2019, at 8:52 AM, Matt Price  wrote:
> 
> I'm seeing something I hadn't noticed before in src block html exports. 
> Instead of producing structures like:
> 
> 
> 
> ...
> ...
> ...
> 
> 
> 
> each individual like is wrapped in its own  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 "%s"
> (format num-fmt line-num)))
>  ;; Transcoded src line.
>  (format "%s"
>   (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 "%s"
> 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  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
> 





[O] superfluous tags in html src block output

2019-09-14 Thread Matt Price
I'm seeing something I hadn't noticed before in src block html exports.
Instead of producing structures like:



...
...
...



each individual like is wrapped in its own  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 "%s"
(format num-fmt line-num)))
 ;; Transcoded src line.
 (format "%s"
  (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 "%s"
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  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