We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To reproduce:
let md = require('markdown-it')(); let container = require('markdown-it-container'); md.use(container, 'column'); let src = ` ::: column Lorem ipsum ::: `; console.log(md.render(src));
gives tokens:
[ Token {type: "container_column_open", tag: "div", attrs: null, map: Array(2), nesting: 1, …}, Token {type: "paragraph_open", tag: "p", attrs: null, map: Array(2), nesting: 1, …} ... ]
Note that div and p both have nesting === 1, which is incorrect, as p is inside div.
div
p
nesting === 1
This results in arve0/markdown-it-attrs#72, attributes on the wrong opening tag.
The text was updated successfully, but these errors were encountered:
It is correct. Nesting does not represent a level of nesting, it represent a change of level of nesting.
See here for more details.
I believe what you are looking for is level property which is hidden behind … in your dump.
level
…
Full dump of tokens:
[ Token { type: 'container_column_open', tag: 'div', attrs: null, map: [ 1, 3 ], nesting: 1, level: 0, children: null, content: '', markup: ':::', info: ' column', meta: null, block: true, hidden: false }, Token { type: 'paragraph_open', tag: 'p', attrs: null, map: [ 2, 3 ], nesting: 1, level: 1, children: null, content: '', markup: '', info: '', meta: null, block: true, hidden: false }, Token { type: 'inline', tag: '', attrs: null, map: [ 2, 3 ], nesting: 0, level: 2, children: [ [Token] ], content: 'Lorem ipsum', markup: '', info: '', meta: null, block: true, hidden: false }, Token { type: 'paragraph_close', tag: 'p', attrs: null, map: null, nesting: -1, level: 1, children: null, content: '', markup: '', info: '', meta: null, block: true, hidden: false }, Token { type: 'container_column_close', tag: 'div', attrs: null, map: null, nesting: -1, level: 0, children: null, content: '', markup: ':::', info: '', meta: null, block: true, hidden: false } ]
Sorry, something went wrong.
No branches or pull requests
To reproduce:
gives tokens:
Note that
div
andp
both havenesting === 1
, which is incorrect, asp
is insidediv
.This results in arve0/markdown-it-attrs#72, attributes on the wrong opening tag.
The text was updated successfully, but these errors were encountered: