gongzhitaao / orgcss

Simple and clean CSS for Org-exported HTML

Home Page:https://gongzhitaao.org/orgcss/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extra border around the code block

mrprofessor opened this issue · comments

orgcss is showing an extra border around the code block

my org file:

#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://gongzhitaao.org/orgcss/org.css"/>

* Source code
** python

#+BEGIN_SRC python

import os

print("Hello people")

#+END_SRC

Result

image

I am using org version 9.4

Thank you @mrprofessor for reporting this. Yes, I saw this bug. Sorry I didn't reply earlier. I was busy with other work stuff. I will investigate sometime this week.

The stable version of Org is 9.3.7, as of June 2020, and I couldn't reproduce this on the current stable version. Are you using the dev version?

I have the same issue on Org 9.3 and Org 9.3.6. I was able to work around this by adding the line #+options: html-style:nil to my org document, however this makes src blocks with no language render with no border. You can obtain a border for them by adding a dummy language to the src block, e.g.

#+begin_src fake-language
fake code
#+end_src

@pjhuxford Thanks, let me try reproducing this.

Using #+HTML_HEAD in an org file then C-c C-e h h (org-export-dispatch html) appends superfluous css codes generated automatically by org mode. Inside that code, pre { border: 1px solid #ccc; ... is defined. That's the reason extra border appears.

To just turn off the default style, customize org-html-head-include-default-style variable, or use this option line #+OPTIONS: html-style:nil in the Org file. Org doc.

@shichaoxia Thanks, that makes sense. I was wondering why I couldn't reproduce this as I configure this in my init file.