- There are special token object, "inline containers", having nested token
- There are special token objects, "inline containers", having nested token
sequences with inline markup (bold, italic, text, ...).
sequences with inline markup (bold, italic, text, ...).
Each token has common fields:
Each token has common fields:
@ -90,7 +90,8 @@ registered in one of chain with unique name.
Rules are managed by names via [Ruler](https://markdown-it.github.io/markdown-it/#Ruler) instances and `enable` / `disable` methods in [MarkdownIt](https://markdown-it.github.io/markdown-it/#MarkdownIt).
Rules are managed by names via [Ruler](https://markdown-it.github.io/markdown-it/#Ruler) instances and `enable` / `disable` methods in [MarkdownIt](https://markdown-it.github.io/markdown-it/#MarkdownIt).
You can note, that some rules have "validation mode" - in this mode rule does not
You can note, that some rules have "validation mode" - in this mode rule does not
modify token stream, and only search end of token. It's one of important design principle - token stream is "write only" on block & inline parse stages.
modify token stream, and only look ahead for the end of token. It's one of
important design principle - token stream is "write only" on block & inline parse stages.
Parser is designed to keep rules independent. You can safely disable any, or
Parser is designed to keep rules independent. You can safely disable any, or
add new one. There are no universal recipes how to create new rules - design of
add new one. There are no universal recipes how to create new rules - design of
@ -99,7 +100,7 @@ can investigate existing rules & plugins to see possible approaches.
Also, in complex cases you can try to ask for help in tracker. Condition is very
Also, in complex cases you can try to ask for help in tracker. Condition is very
simple - it should be clear from your ticket, that you studied docs, sources,
simple - it should be clear from your ticket, that you studied docs, sources,
and tryed to do something yourself. We never reject with help to real developpers.
and tried to do something yourself. We never reject with help to real developpers.
## Renderer
## Renderer
@ -107,11 +108,11 @@ and tryed to do something yourself. We never reject with help to real developper
After token stream is generated, it's passed to [renderer](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
After token stream is generated, it's passed to [renderer](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
It just plays all tokens, passing each to rule with the same name as token type.
It just plays all tokens, passing each to rule with the same name as token type.
Randerer rules are located in `md.renderer.rules[name]` and are simple functions
Renderer rules are located in `md.renderer.rules[name]` and are simple functions
- Be specific. Generic questions like "how to do plugins" and
- Be specific. Generic questions like "how to do plugins" and
@ -35,7 +35,7 @@ Prior to continue, make sure you've readed:
To simplify search:
To simplify search:
- add to `package.json` keyswords `markdown-it` and `markdown-it-plugin` for plugins
- add to `package.json` keyswords `markdown-it` and `markdown-it-plugin` for plugins.
- add keyword `markdown-it` for any other related packages.
- add keyword `markdown-it` for any other related packages.
@ -69,13 +69,13 @@ __Note.__ Don't try to replace text with html markup! That's not secure.
#### Why my inline rule is not executed?
#### Why my inline rule is not executed?
Inline parser skips porsion of texts for the best speed. It stops only on [small set of chars](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_inline/text.js), which can be tokens. We did not made this list extendable, also for performance reasons.
Inline parser skips peases of texts for the best speed. It stops only on [small set of chars](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_inline/text.js), which can be tokens. We did not made this list extendable, also for performance reasons.
If you are absolutely sure, that something important is missed there - create a
If you are absolutely sure, that something important is missed there - create a
ticket and we will add new charcodes.
ticket and we will consider adding new charcodes.
#### Why do you reject to accept some useful things?
#### Why do you reject some useful things?
We do markdown parser. It should keep "markdown spirit". Other things should
We do markdown parser. It should keep "markdown spirit". Other things should
be kept separate (in plugins, for example). We have no clear criteria, sorry.
be kept separate (in plugins, for example). We have no clear criteria, sorry.