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

Method __init__

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected