chore: Add eslint rule for no-shadow (#6658)
* chore: Add eslint rule for no-shadow * fix
This commit is contained in:
@@ -11,7 +11,6 @@ function isHardbreak(token: Token) {
|
||||
export default function markdownBreakToParagraphs(md: MarkdownIt) {
|
||||
// insert a new rule after the "inline" rules are parsed
|
||||
md.core.ruler.after("inline", "breaks", (state) => {
|
||||
const { Token } = state;
|
||||
const tokens = state.tokens;
|
||||
|
||||
// work backwards through the tokens and find text that looks like a br
|
||||
@@ -30,8 +29,8 @@ export default function markdownBreakToParagraphs(md: MarkdownIt) {
|
||||
count++;
|
||||
}
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
const isLast = i === count - 1;
|
||||
for (let j = 0; j < count; j++) {
|
||||
const isLast = j === count - 1;
|
||||
|
||||
token = new Token("paragraph_open", "p", 1);
|
||||
nodes.push(token);
|
||||
|
||||
@@ -56,9 +56,9 @@ export default function markdownItCheckbox(md: MarkdownIt): void {
|
||||
|
||||
// work backwards through the tokens and find text that looks like a checkbox
|
||||
for (let i = tokens.length - 1; i > 0; i--) {
|
||||
const matches = looksLikeChecklist(tokens, i);
|
||||
if (matches) {
|
||||
const value = matches[1];
|
||||
const matchesChecklist = looksLikeChecklist(tokens, i);
|
||||
if (matchesChecklist) {
|
||||
const value = matchesChecklist[1];
|
||||
const checked = value.toLowerCase() === "x";
|
||||
|
||||
// convert surrounding list tokens
|
||||
|
||||
Reference in New Issue
Block a user