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

Method list_item_open

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

Source from the content-addressed store, hash-verified

210 ###################################################
211
212 def list_item_open(
213 self,
214 tokens: Sequence[Token],
215 idx: int,
216 options: OptionsDict,
217 env: EnvType,
218 ) -> str:
219 token = tokens[idx]
220 result = self.renderToken(tokens, idx, options, env)
221 if token.meta and "checked" in token.meta:
222 checked_attr = ' checked=""' if token.meta["checked"] else ""
223 disabled_attr = (
224 "" if options.get("tasklists_editable", False) else ' disabled=""'
225 )
226 result += (
227 '<input class="task-list-item-checkbox"'
228 f'{disabled_attr} type="checkbox"{checked_attr}> '
229 )
230 return result
231
232 def code_inline(
233 self, tokens: Sequence[Token], idx: int, options: OptionsDict, env: EnvType

Callers

nothing calls this directly

Calls 1

renderTokenMethod · 0.95

Tested by

no test coverage detected