website/node_modules/remarkable/docs/parsing_core.md

Core rules

The core rules are the one managing global parsing or Markdown syntaxes requiring a global access to the document. For example, management of reference links or abbreviations. They are also the one triggering the execution of block and inline rules.

A core rule is a function expecting a single StateCore argument. The code for the StateCore prototype is in index.js and its data consists of:

The rest are mostly components of the underlying remarkable instance.

Some core rules process directly the src to produce a new set of tokens, others process the existing list of tokens in order to produce a new one.

The most important predefined core rules are block and inline which are reponsible for calling the subparsers for the block and inline rules.

To better understand how the core rules work, please read the code in parser_core.js and the predefined rules in rules_core/.



JohnCoene/chirp documentation built on May 25, 2021, 6:33 p.m.