MCPcopy Create free account
hub / github.com/executablebooks/markdown-it-py / code_block

Method code_block

markdown_it/renderer.py:244–259  ·  view source on GitHub ↗
(
        self,
        tokens: Sequence[Token],
        idx: int,
        options: OptionsDict,
        env: EnvType,
    )

Source from the content-addressed store, hash-verified

242 )
243
244 def code_block(
245 self,
246 tokens: Sequence[Token],
247 idx: int,
248 options: OptionsDict,
249 env: EnvType,
250 ) -> str:
251 token = tokens[idx]
252
253 return (
254 "<pre"
255 + self.renderAttrs(token)
256 + "><code>"
257 + escapeHtml(tokens[idx].content)
258 + "</code></pre>\n"
259 )
260
261 def fence(
262 self,

Callers

nothing calls this directly

Calls 2

renderAttrsMethod · 0.95
escapeHtmlFunction · 0.85

Tested by

no test coverage detected