MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / LegacyEmExtension

Class LegacyEmExtension

markdown/extensions/legacy_em.py:20–36  ·  view source on GitHub ↗

Add legacy_em extension to Markdown class.

Source from the content-addressed store, hash-verified

18
19
20class LegacyEmExtension(Extension):
21 """ Add legacy_em extension to Markdown class."""
22
23 def extendMarkdown(self, md):
24 """ Register the processor.
25
26 | Class Instance | Registry | Name | Priority |
27 | ------------------------------------------------------------------ | ---------------------------------------------------------------- | ------------ | :------: |
28 | [`DelimiterProcessor`][markdown.inlinepatterns.DelimiterProcessor] | [`inlinepatterns`][markdown.inlinepatterns.build_inlinepatterns] | `em_strong` | `60` |
29
30 """
31 # flake8: noqa: E501 27-29
32
33 if md.delimiters is not None:
34 md.delimiters.add('_', 'strong,em')
35 else:
36 md.inlinePatterns.register(DelimiterProcessor('_', 'strong,em', md), 'em_strong', 60)
37
38def makeExtension(**kwargs): # pragma: no cover
39 """ Return an instance of the `LegacyEmExtension` """

Callers 1

makeExtensionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected