![]() ![]() Or, creating new token types with rules and applying them through new renderers. □ Tip: Given the option, modifying rendering via rules instead of overriding the default renderer is almost always preferred. □ Tip: If you are looking for examples of how to write rules, make sure to reference the source of the rules that are bundled with Markdown-it! These are contained in lib/rules_core, lib/rules_block, and lib/rules_inline Overriding Default Renderers Regardless of which rule type you are writing, usually you are modifying output by either removing, adding, and/or replacing tokens in the chain, which can be directly accessed through state.tokens, as well as utility methods, like state.push or arrayReplaceAt used with tokens. ![]() Can update state.pos to move pointer for next chunk of text to become pending.expected boolean return ( true stops further rule processing).Called with state, line, endLine, silent. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |