summaryrefslogtreecommitdiff
path: root/markdown/extensions
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2022-05-27 09:13:09 -0400
committerGitHub <noreply@github.com>2022-05-27 09:13:09 -0400
commita767b2daaad78ba32d45a4f1dabb7c5e218f030a (patch)
tree0a395d3751ed27fdbebc1c64a565384e5048b3cb /markdown/extensions
parentdc434df776fe9af36fe07c4e782e51035ce30e1f (diff)
downloadpython-markdown-a767b2daaad78ba32d45a4f1dabb7c5e218f030a.tar.gz
Remove previously deprecated objects
This completely removes all objects which were deprecated in version 3.0 (this change will be included in version 3.4). Given the time that has passed, and the fact that older unmaintained extensions are not likely to support the new minimum Python version, this is little concern about breaking older extensions.
Diffstat (limited to 'markdown/extensions')
-rw-r--r--markdown/extensions/__init__.py21
-rw-r--r--markdown/extensions/smarty.py8
2 files changed, 1 insertions, 28 deletions
diff --git a/markdown/extensions/__init__.py b/markdown/extensions/__init__.py
index 4712e25..2d8d72a 100644
--- a/markdown/extensions/__init__.py
+++ b/markdown/extensions/__init__.py
@@ -19,7 +19,6 @@ Copyright 2004 Manfred Stienstra (the original version)
License: BSD (see LICENSE.md for details).
"""
-import warnings
from ..util import parseBoolValue
@@ -70,24 +69,6 @@ class Extension:
for key, value in items:
self.setConfig(key, value)
- def _extendMarkdown(self, *args):
- """ Private wrapper around extendMarkdown. """
- md = args[0]
- try:
- self.extendMarkdown(md)
- except TypeError as e:
- if "missing 1 required positional argument" in str(e):
- # Must be a 2.x extension. Pass in a dumby md_globals.
- self.extendMarkdown(md, {})
- warnings.warn(
- "The 'md_globals' parameter of '{}.{}.extendMarkdown' is "
- "deprecated.".format(self.__class__.__module__, self.__class__.__name__),
- category=DeprecationWarning,
- stacklevel=2
- )
- else:
- raise
-
def extendMarkdown(self, md):
"""
Add the various processors and patterns to the Markdown Instance.
@@ -98,8 +79,6 @@ class Extension:
* md: The Markdown instance.
- * md_globals: Global variables in the markdown module namespace.
-
"""
raise NotImplementedError(
'Extension "%s.%s" must define an "extendMarkdown"'
diff --git a/markdown/extensions/smarty.py b/markdown/extensions/smarty.py
index 894805f..c4bfd58 100644
--- a/markdown/extensions/smarty.py
+++ b/markdown/extensions/smarty.py
@@ -83,7 +83,7 @@ smartypants.py license:
from . import Extension
from ..inlinepatterns import HtmlInlineProcessor, HTML_RE
from ..treeprocessors import InlineProcessor
-from ..util import Registry, deprecated
+from ..util import Registry
# Constants for quote education.
@@ -155,12 +155,6 @@ class SubstituteTextPattern(HtmlInlineProcessor):
self.replace = replace
self.md = md
- @property
- @deprecated("Use 'md' instead.")
- def markdown(self):
- # TODO: remove this later
- return self.md
-
def handleMatch(self, m, data):
result = ''
for part in self.replace: