[v1.2.2] fix inline attr
fix utils/findOpenToken()
This commit is contained in:
parent
21b2b98bfb
commit
25254cb8f7
2 changed files with 5 additions and 3 deletions
|
@ -41,10 +41,12 @@ function parseAttrs(s, re, limit=65536) {
|
|||
function findOpenToken(tokens, i) {
|
||||
const tokenC = tokens[i];
|
||||
if (!tokenC) return null;
|
||||
const {level} = tokenC;
|
||||
let dlevel = 0;
|
||||
for (i--; i>=0; i--) {
|
||||
const token = tokens[i];
|
||||
if (token.level === level) return token;
|
||||
const {nesting} = token;
|
||||
if (nesting === 1 && dlevel === 0) return token;
|
||||
dlevel += nesting;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@sup39/markdown-it-attr",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"description": "A markdown-it plugin to write id, classes, and attributes",
|
||||
"keywords": [
|
||||
"markdown",
|
||||
|
|
Reference in a new issue