Skip to content

codehilite and fenced_code don't work together #60

@wch

Description

@wch

I'm trying to get syntax highlighting to work with fenced code, but it's not cooperating.

Here's the contents of the input file, codetest.md:

~~~~{.r}
# r code
c(1,2,3)
~~~~

And here's what happens when I try to run it. Apparently there's some sort of problem with pygments? This is running on Ubuntu 11.10, python 2.7.2.

Traceback (most recent call last):
  File "/home/winston/.local/bin/markdown_py", line 5, in <module>
    pkg_resources.run_script('Markdown==2.1.0', 'markdown_py')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 467, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1200, in run_script
    execfile(script_filename, namespace, namespace)
  File "/home/winston/.local/lib/python2.7/site-packages/Markdown-2.1.0-py2.7.egg/EGG-INFO/scripts/markdown_py", line 34, in <module>
    run()
  File "/home/winston/.local/lib/python2.7/site-packages/Markdown-2.1.0-py2.7.egg/markdown/__main__.py", line 81, in run
    markdown.markdownFromFile(**options)
  File "/home/winston/.local/lib/python2.7/site-packages/Markdown-2.1.0-py2.7.egg/markdown/__init__.py", line 416, in markdownFromFile
    kwargs.get('encoding', None))
  File "/home/winston/.local/lib/python2.7/site-packages/Markdown-2.1.0-py2.7.egg/markdown/__init__.py", line 346, in convertFile
    html = self.convert(text)
  File "/home/winston/.local/lib/python2.7/site-packages/Markdown-2.1.0-py2.7.egg/markdown/__init__.py", line 280, in convert
    self.lines = prep.run(self.lines)
  File "/home/winston/.local/lib/python2.7/site-packages/Markdown-2.1.0-py2.7.egg/markdown/extensions/fenced_code.py", line 128, in run
    code = highliter.hilite()
  File "/home/winston/.local/lib/python2.7/site-packages/Markdown-2.1.0-py2.7.egg/markdown/extensions/codehilite.py", line 99, in hilite
    noclasses=self.noclasses)
  File "/usr/lib/python2.7/dist-packages/pygments/formatters/html.py", line 347, in __init__
    self.noclasses = get_bool_opt(options, 'noclasses', False)
  File "/usr/lib/python2.7/dist-packages/pygments/util.py", line 58, in get_bool_opt
    string, optname))
pygments.util.OptionError: Invalid type [False, 'Use inline styles instead of CSS classes - Default false'] for option noclasses; use 1/0, yes/no, true/false, on/off

It works fine if I use just codehilite (with indented code), or if I use fenced_code without codehilite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions