Takes token stream and generates HTML. :param tokens: list on block tokens to render :param options: params of parser instance :param env: additional data from parsed input
(
self, tokens: Sequence[Token], options: OptionsDict, env: EnvType
)
| 65 | } |
| 66 | |
| 67 | def render( |
| 68 | self, tokens: Sequence[Token], options: OptionsDict, env: EnvType |
| 69 | ) -> str: |
| 70 | """Takes token stream and generates HTML. |
| 71 | |
| 72 | :param tokens: list on block tokens to render |
| 73 | :param options: params of parser instance |
| 74 | :param env: additional data from parsed input |
| 75 | |
| 76 | """ |
| 77 | result = "" |
| 78 | |
| 79 | for i, token in enumerate(tokens): |
| 80 | if token.type == "inline": |
| 81 | if token.children: |
| 82 | result += self.renderInline(token.children, options, env) |
| 83 | elif token.type in self.rules: |
| 84 | result += self.rules[token.type](tokens, i, options, env) |
| 85 | else: |
| 86 | result += self.renderToken(tokens, i, options, env) |
| 87 | |
| 88 | return result |
| 89 | |
| 90 | def renderInline( |
| 91 | self, tokens: Sequence[Token], options: OptionsDict, env: EnvType |
nothing calls this directly
no test coverage detected