File: 5.0_migration.md

package info (click to toggle)
node-markdown-it 22.2.3%2Bdfsg%2B~12.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,816 kB
  • sloc: javascript: 6,872; makefile: 226
file content (23 lines) | stat: -rw-r--r-- 1,033 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Migration to v5
===============

v5 has the same external API as v4, only internals were changed. Some external
plugins may need update (all plugins from `markdown-it` github organization are
up to date).


## For users

External API did not change.

- If you use `markdown-it` with plugins, make sure to update them.


## For plugin developers

- added `stateBlock.sCount` to calculate indents instead of `stateBlock.tShift`, it only differs if tabs are present:
  - `stateBlock.tShift` is used to calculate a number of *characters* (tab is 1 character)
  - `stateBlock.sCount` is used to calculate the block *offset* (tab is 1-4 characters depending on position)
- added `stateInline.ruler2` and `stateInline.delimiters` needed to parse emphasis-like markup better
  - emphasis-like tags now can't be skipped with `stateInline.skipToken`, they treat a sequence of markers (e.g. `***`) as a token instead
  - `stateInline.delimiters` is linked with `stateInline.tokens`, so truncating/splicing `stateInline.tokens` may break things