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

Method __init__

markdown/extensions/codehilite.py:115–133  ·  view source on GitHub ↗
(self, src: str, **options)

Source from the content-addressed store, hash-verified

113 """
114
115 def __init__(self, src: str, **options):
116 self.src = src
117 self.lang: str | None = options.pop('lang', None)
118 self.guess_lang: bool = options.pop('guess_lang', True)
119 self.use_pygments: bool = options.pop('use_pygments', True)
120 self.lang_prefix: str = options.pop('lang_prefix', 'language-')
121 self.pygments_formatter: str | Callable = options.pop('pygments_formatter', 'html')
122
123 if 'linenos' not in options:
124 options['linenos'] = options.pop('linenums', None)
125 if 'cssclass' not in options:
126 options['cssclass'] = options.pop('css_class', 'codehilite')
127 if 'wrapcode' not in options:
128 # Override Pygments default
129 options['wrapcode'] = True
130 # Disallow use of `full` option
131 options['full'] = False
132
133 self.options = options
134
135 def hilite(self, shebang: bool = True) -> str:
136 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected