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

Method image

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

Source from the content-addressed store, hash-verified

311 )
312
313 def image(
314 self,
315 tokens: Sequence[Token],
316 idx: int,
317 options: OptionsDict,
318 env: EnvType,
319 ) -> str:
320 token = tokens[idx]
321
322 # "alt" attr MUST be set, even if empty. Because it's mandatory and
323 # should be placed on proper position for tests.
324 if token.children:
325 token.attrSet("alt", self.renderInlineAsText(token.children, options, env))
326 else:
327 token.attrSet("alt", "")
328
329 return self.renderToken(tokens, idx, options, env)
330
331 def hardbreak(
332 self, tokens: Sequence[Token], idx: int, options: OptionsDict, env: EnvType

Callers

nothing calls this directly

Calls 3

renderInlineAsTextMethod · 0.95
renderTokenMethod · 0.95
attrSetMethod · 0.80

Tested by

no test coverage detected