Permalink
Browse files

[issue #83] Allow 'cssclass' code coloring option (passed to pygments…

…) to be overridden
  • Loading branch information...
1 parent f487631 commit 658ade1ea6023579ed0780ebb8f24feab30407bf @trentm committed Apr 20, 2012
Showing with 10 additions and 3 deletions.
  1. +7 −1 CHANGES.md
  2. +1 −1 TODO.txt
  3. +2 −1 lib/markdown2.py
View
@@ -2,7 +2,13 @@
## python-markdown2 1.4.1 (not yet released)
-(nothing yet)
+- [issue #83, 'fenced-code-blocks' and 'code-color' extras] Allow 'cssclass'
+ code coloring option (passed to pygments) to be overridden (by
+ https://github.com/kaishaku). E.g.:
+
+ import markdown2
+ html = markdown2.markdown(text,
+ extras={'fenced-code-blocks': {'cssclass': 'mycode'}})
## python-markdown2 1.4.0
View
@@ -1,4 +1,4 @@
-- py3: commit, travis-ci, py2.4 test (broken?)
+- py3: py2.4 test (broken?)
- add "markdown-in-html" extra to wiki
- add "smarty-pants" extra to wiki
- add "html-classes" extra to wiki
View
@@ -1442,7 +1442,8 @@ def wrap(self, source, outfile):
"""Return the source with a code, pre, and div."""
return self._wrap_div(self._wrap_pre(self._wrap_code(source)))
- formatter = HtmlCodeFormatter(cssclass="codehilite", **formatter_opts)
+ formatter_opts.setdefault("cssclass", "codehilite")
+ formatter = HtmlCodeFormatter(**formatter_opts)
return pygments.highlight(codeblock, lexer, formatter)
def _code_block_sub(self, match, is_fenced_code_block=False):

0 comments on commit 658ade1

Please sign in to comment.