fniessen / org-html-themes

Transform your Org mode files into stunning HTML documents in minutes with our Org mode HTML theme. Elevate your productivity and impress your readers! #orgmode #html #theme #productivity #design

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

code block export issue

thomas-villagers opened this issue · comments

Hi,

the export of code blocks stopped working for me with an orgmode update mode from 8.X to 9.0.9.
All line breaks are removed from the exported html (this does not happen with the "plain" style)

Minimal example:

`
#+TITLE: Test
#+SETUPFILE: setup/theme-readtheorg-local.setup

#+BEGIN_SRC C
#include <stdio.h>

int main() {
printf("Hello World");
return 0;
}
#+END_SRC
`

codeblock

thank you!

Dear Thomas. I can't replicate your problem: see https://www.screencast.com/t/a68LoSWPtF.

Try to see whether updating your version does solve the problem?

FYI, in the head of the HTML, I do have:

<link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js"></script>
<script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>

Hi, I was also having this exact problem after one of the updates of org mode. One thing I noticed is that the generated html formats source code blocks differently. For instance, older org mode did this:

<pre class="src src-sh">echo 1
</pre>
</div>

The new version does this

<pre><code class="src src-sh">echo 1
</code></pre>
</div>

I tried searching the source code and found an option which controls this behavior, so setting

(setq org-html-keep-old-src t)

fixes the problem. Some more googling revealed (https://www.mail-archive.com/emacs-orgmode@gnu.org/msg113099.html) that the change was made to support the "klipse" functionality - live editing of the source code.

@alexvorobiev Thanks for the information!