Browse Source

some fixes for syntax highlighting

pull/68/head
adam j hartz 1 month ago
parent
commit
2c31d0861b
Signed by: hz <hartz@mit.edu> GPG Key ID: 5FDD2840E179AD62
1 changed files with 1 additions and 8 deletions
  1. +1
    -8
      catsoop/language.py

+ 1
- 8
catsoop/language.py View File

@@ -651,7 +651,7 @@ def _make_python_handler(context, fulltext):
# decide whether to show the code
if "show" in opts:
opts.remove("show")
code = '<pre><code class="lang-python">%s</code></pre>'
code = '<pre><code class="language-python">%s</code></pre>'
out += code % html_format(body)
# decide whether to run the code
if "norun" in opts:
@@ -977,13 +977,6 @@ def handle_custom_tags(context, text):
if isinstance(i.attrs.setdefault("class", []), str):
i.attrs["class"] = [i.attrs["class"]]

for j in range(len(i.attrs["class"])):
if (
not i.attrs["class"][j].startswith("lang-")
and i.attrs["class"][j] != "highlight-lines"
):
i.attrs["class"][j] = "lang-%s" % i.attrs["class"][j]

# set default language if no language is given
if default_code_class is not None:
if len(i.attrs["class"]) == 0:


Loading…
Cancel
Save