diff options
author | Waylan Limberg <waylan.limberg@icloud.com> | 2015-03-14 19:52:00 -0400 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2018-01-11 19:04:49 -0500 |
commit | 6366e5ae8f0ae19c033a2c24c217001c1512292b (patch) | |
tree | bd92a121d34228f53fde139d2f8da77b58a835c1 | |
parent | fd628f3e540425b883f36a9c0d288ef1aafdb19e (diff) | |
download | markdown-6366e5ae8f0ae19c033a2c24c217001c1512292b.tar.gz markdown-6366e5ae8f0ae19c033a2c24c217001c1512292b.tar.bz2 markdown-6366e5ae8f0ae19c033a2c24c217001c1512292b.zip |
Removed support for deprecated config in ext name.
-rw-r--r-- | markdown/core.py | 21 | ||||
-rw-r--r-- | tests/test_apis.py | 7 |
2 files changed, 2 insertions, 26 deletions
diff --git a/markdown/core.py b/markdown/core.py index a10f41a..e92aad0 100644 --- a/markdown/core.py +++ b/markdown/core.py @@ -151,30 +151,13 @@ class Markdown(object): return self def build_extension(self, ext_name, configs): - """Build extension by name, then return the module. - - The extension name may contain arguments as part of the string in the - following format: "extname(key1=value1,key2=value2)" + """ + Build extension by name, then return the module. """ configs = dict(configs) - # Parse extensions config params (ignore the order) - pos = ext_name.find("(") # find the first "(" - if pos > 0: - ext_args = ext_name[pos+1:-1] - ext_name = ext_name[:pos] - pairs = [x.split("=") for x in ext_args.split(",")] - configs.update([(x.strip(), y.strip()) for (x, y) in pairs]) - warnings.warn('Setting configs in the Named Extension string is ' - 'deprecated. It is recommended that you ' - 'pass an instance of the extension class to ' - 'Markdown or use the "extension_configs" keyword. ' - 'The current behavior will raise an error in version 2.7. ' - 'See the Release Notes for Python-Markdown version ' - '2.6 for more info.', DeprecationWarning) - # Get class name (if provided): `path.to.module:ClassName` ext_name, class_name = ext_name.split(':', 1) \ if ':' in ext_name else (ext_name, '') diff --git a/tests/test_apis.py b/tests/test_apis.py index 48e79e8..d128948 100644 --- a/tests/test_apis.py +++ b/tests/test_apis.py @@ -385,13 +385,6 @@ class TestErrors(unittest.TestCase): markdown.Markdown, extensions=['footnotes'] ) - def testStringConfigExtention(self): - """ Test that passing configs to an Extension in the name raises a DeprecationWarning. """ - self.assertRaises( - DeprecationWarning, - markdown.Markdown, extensions=['markdown.extension.footnotes(PLACE_MARKER=FOO)'] - ) - def _create_fake_extension(name, has_factory_func=True, is_wrong_type=False, use_old_style=False): """ Create a fake extension module for testing. """ |