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

Method render

markdown_it/main.py:275–287  ·  view source on GitHub ↗

Render markdown string into html. It does all magic for you :). :param src: source string :param env: environment sandbox :returns: The output of the loaded renderer `env` can be used to inject additional metadata (`{}` by default). But you will not need it

(self, src: str, env: EnvType | None = None)

Source from the content-addressed store, hash-verified

273 return state.tokens
274
275 def render(self, src: str, env: EnvType | None = None) -> Any:
276 """Render markdown string into html. It does all magic for you :).
277
278 :param src: source string
279 :param env: environment sandbox
280 :returns: The output of the loaded renderer
281
282 `env` can be used to inject additional metadata (`{}` by default).
283 But you will not need it with high probability. See also comment
284 in [[MarkdownIt.parse]].
285 """
286 env = {} if env is None else env
287 return self.renderer.render(self.parse(src, env), self.options, env)
288
289 def parseInline(self, src: str, env: EnvType | None = None) -> list[Token]:
290 """The same as [[MarkdownIt.parse]] but skip all block rules.

Callers 15

test_fuzzingFunction · 0.95
test_highlight_argumentsFunction · 0.95
test_commonmark_extrasFunction · 0.95
test_normalize_urlFunction · 0.95
test_tasklistsFunction · 0.95
test_alertsFunction · 0.95
test_issue_fixesFunction · 0.95
test_no_end_newlineFunction · 0.95
test_empty_envFunction · 0.95
test_fileFunction · 0.95

Calls 1

parseMethod · 0.95

Tested by 15

test_fuzzingFunction · 0.76
test_highlight_argumentsFunction · 0.76
test_commonmark_extrasFunction · 0.76
test_normalize_urlFunction · 0.76
test_tasklistsFunction · 0.76
test_alertsFunction · 0.76
test_issue_fixesFunction · 0.76
test_no_end_newlineFunction · 0.76
test_empty_envFunction · 0.76
test_fileFunction · 0.76