From cba86d6175d00b897d6f5c4b3fec640e7309de60 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Tue, 7 Apr 2015 21:01:55 -0400 Subject: smart_emphasis keyword > legacy_em extension. The smart_strong extension has been removed and its behavior is now the default (smart em and smart strong are the default). The legacy_em extension restores legacy behavior (no smart em or smart strong). This completes the removal of keywords. All parser behavior is now modified by extensions, not by keywords on the Markdown class. --- tests/misc/em_strong_complex.html | 2 +- tests/misc/em_strong_complex.txt | 2 +- tests/misc/underscores.html | 2 +- tests/options/no-smart-emphasis.html | 1 - tests/options/no-smart-emphasis.txt | 1 - tests/test_legacy.py | 2 -- tests/test_syntax/extensions/test_legacy_em.py | 40 ++++++++++++++++++++++++++ 7 files changed, 43 insertions(+), 7 deletions(-) delete mode 100644 tests/options/no-smart-emphasis.html delete mode 100644 tests/options/no-smart-emphasis.txt create mode 100644 tests/test_syntax/extensions/test_legacy_em.py (limited to 'tests') diff --git a/tests/misc/em_strong_complex.html b/tests/misc/em_strong_complex.html index 3befa70..65faddf 100644 --- a/tests/misc/em_strong_complex.html +++ b/tests/misc/em_strong_complex.html @@ -1,7 +1,7 @@

test test test test

test test test test

test

-

test_

+

test

test test_

test test

test_test test_test

diff --git a/tests/misc/em_strong_complex.txt b/tests/misc/em_strong_complex.txt index 66f4ff1..0425971 100644 --- a/tests/misc/em_strong_complex.txt +++ b/tests/misc/em_strong_complex.txt @@ -4,7 +4,7 @@ ___test test_ test test__ ___test___ -__test___ +__test__ ___test_ test___ diff --git a/tests/misc/underscores.html b/tests/misc/underscores.html index 54bd9f9..72d51b8 100644 --- a/tests/misc/underscores.html +++ b/tests/misc/underscores.html @@ -1,6 +1,6 @@

THIS_SHOULD_STAY_AS_IS

Here is some emphasis, ok?

Ok, at least this should work.

-

THISSHOULDSTAY

+

THIS__SHOULD__STAY

Here is some strong stuff.

THISSHOULDSTAY?

\ No newline at end of file diff --git a/tests/options/no-smart-emphasis.html b/tests/options/no-smart-emphasis.html deleted file mode 100644 index c4f1381..0000000 --- a/tests/options/no-smart-emphasis.html +++ /dev/null @@ -1 +0,0 @@ -

connectedwords_

\ No newline at end of file diff --git a/tests/options/no-smart-emphasis.txt b/tests/options/no-smart-emphasis.txt deleted file mode 100644 index cf500b5..0000000 --- a/tests/options/no-smart-emphasis.txt +++ /dev/null @@ -1 +0,0 @@ -_connected_words_ \ No newline at end of file diff --git a/tests/test_legacy.py b/tests/test_legacy.py index 976a84e..0d0dd09 100644 --- a/tests/test_legacy.py +++ b/tests/test_legacy.py @@ -46,8 +46,6 @@ class TestOptions(LegacyTestCase): html4 = Kwargs(output_format='html4') - no_smart_emphasis = Kwargs(smart_emphasis=False) - class TestPhp(LegacyTestCase): """ diff --git a/tests/test_syntax/extensions/test_legacy_em.py b/tests/test_syntax/extensions/test_legacy_em.py new file mode 100644 index 0000000..ddb2079 --- /dev/null +++ b/tests/test_syntax/extensions/test_legacy_em.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +""" +Python Markdown + +A Python implementation of John Gruber's Markdown. + +Documentation: https://python-markdown.github.io/ +GitHub: https://github.com/Python-Markdown/markdown/ +PyPI: https://pypi.org/project/Markdown/ + +Started by Manfred Stienstra (http://www.dwerg.net/). +Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). +Currently maintained by Waylan Limberg (https://github.com/waylan), +Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). + +Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) +Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) +Copyright 2004 Manfred Stienstra (the original version) + +License: BSD (see LICENSE.md for details). +""" + +from __future__ import unicode_literals +from markdown.test_tools import TestCase + + +class TestLegacyEm(TestCase): + def test_legacy_emphasis(self): + self.assertMarkdownRenders( + '_connected_words_', + '

connectedwords_

', + extensions=['legacy_em'] + ) + + def test_legacy_strong(self): + self.assertMarkdownRenders( + '__connected__words__', + '

connectedwords__

', + extensions=['legacy_em'] + ) -- cgit v1.2.3