From 403cc58b542354a130d1f2c94a559fd0ea2f16fa Mon Sep 17 00:00:00 2001 From: sblondon Date: Wed, 30 Mar 2016 20:09:26 +0200 Subject: Fix lazy ordered list example in documentation The documentation is not accurate when lazy_ol=False parameter is called. The example shows the 'start' attribute to the first
  • tag. However, the attribute is in the
      tag: >>> import markdown >>> s = """ ... 4. Apples ... 5. Oranges ... 6. Pears""" >>> markdown.markdown(s, lazy_ol=False) u'
        \n
      1. Apples
      2. \n
      3. Oranges
      4. \n
      5. Pears
      6. \n
      ' The behaviour of the library is the correct one (https://developer.mozilla.org/fr/docs/Web/HTML/Element/ol), so the documentation need to be fixed, not the library. --- docs/reference.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference.txt b/docs/reference.txt index ac5c724..7268cc6 100644 --- a/docs/reference.txt +++ b/docs/reference.txt @@ -247,8 +247,8 @@ The following options are available on the `markdown.markdown` function: If `lazy_ol` is set to `False`, then markdown will output the following HTML: -
        -
      1. Apples
      2. +
          +
        1. Apples
        2. Oranges
        3. Pears
        -- cgit v1.2.3 From c5cd162cb6a071b9a6ef679571a5b1d80d46fde9 Mon Sep 17 00:00:00 2001 From: Martin Morgenstern Date: Mon, 11 Apr 2016 11:27:04 +0200 Subject: Test if fenced_code honors CodeHilite option use_pygments --- tests/test_extensions.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_extensions.py b/tests/test_extensions.py index 19a1389..a43de79 100644 --- a/tests/test_extensions.py +++ b/tests/test_extensions.py @@ -375,6 +375,18 @@ line 3 '#line 3' ) + def testFencedLanguageAndPygmentsDisabled(self): + """ Test if fenced_code honors CodeHilite option use_pygments=False. """ + + text = '```python\nfrom __future__ import braces\n```' + md = markdown.Markdown( + extensions=[ + markdown.extensions.codehilite.CodeHiliteExtension(use_pygments=False), + 'markdown.extensions.fenced_code' + ] + ) + self.assertTrue('' in md.convert(text)) + class TestHeaderId(unittest.TestCase): """ Test HeaderId Extension. """ -- cgit v1.2.3 From dd669e3cb83960932e12b6942ed1f803f2b57586 Mon Sep 17 00:00:00 2001 From: Martin Morgenstern Date: Mon, 11 Apr 2016 11:32:02 +0200 Subject: Support CodeHilite option use_pygments in fenced_code --- markdown/extensions/fenced_code.py | 1 + 1 file changed, 1 insertion(+) diff --git a/markdown/extensions/fenced_code.py b/markdown/extensions/fenced_code.py index 4af8891..8c9935e 100644 --- a/markdown/extensions/fenced_code.py +++ b/markdown/extensions/fenced_code.py @@ -81,6 +81,7 @@ class FencedBlockPreprocessor(Preprocessor): guess_lang=self.codehilite_conf['guess_lang'][0], css_class=self.codehilite_conf['css_class'][0], style=self.codehilite_conf['pygments_style'][0], + use_pygments=self.codehilite_conf['use_pygments'][0], lang=(m.group('lang') or None), noclasses=self.codehilite_conf['noclasses'][0], hl_lines=parse_hl_lines(m.group('hl_lines')) -- cgit v1.2.3