chore: Add eslint rule for no-shadow (#6658)
* chore: Add eslint rule for no-shadow * fix
This commit is contained in:
@@ -134,7 +134,7 @@ export default class ExtensionManager {
|
||||
plugins,
|
||||
}: {
|
||||
schema: Schema;
|
||||
rules?: Record<string, any>;
|
||||
rules?: markdownit.Options;
|
||||
plugins?: PluginSimple[];
|
||||
}): MarkdownParser {
|
||||
const tokens = this.extensions
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import markdownit, { PluginSimple } from "markdown-it";
|
||||
|
||||
export default function rules({
|
||||
export default function makeRules({
|
||||
rules = {},
|
||||
plugins = [],
|
||||
}: {
|
||||
rules?: Record<string, any>;
|
||||
rules?: markdownit.Options;
|
||||
plugins?: PluginSimple[];
|
||||
}) {
|
||||
const markdownIt = markdownit("default", {
|
||||
|
||||
@@ -221,7 +221,7 @@ export class MarkdownSerializerState {
|
||||
})
|
||||
) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
||||
const [_, lead, inner, trail] = /^(\s*)(.*?)(\s*)$/m.exec(node.text);
|
||||
const [, lead, inner, trail] = /^(\s*)(.*?)(\s*)$/m.exec(node.text);
|
||||
leading += lead;
|
||||
trailing = trail;
|
||||
if (lead || trail) {
|
||||
@@ -366,20 +366,20 @@ export class MarkdownSerializerState {
|
||||
row.forEach((cell, _, j) => {
|
||||
this.out += j === 0 ? "| " : " | ";
|
||||
|
||||
cell.forEach((node) => {
|
||||
cell.forEach((cellNode) => {
|
||||
// just padding the output so that empty cells take up the same space
|
||||
// as headings.
|
||||
// TODO: Ideally we'd calc the longest cell length and use that
|
||||
// to pad all the others.
|
||||
if (
|
||||
node.textContent === "" &&
|
||||
node.content.size === 0 &&
|
||||
node.type.name === "paragraph"
|
||||
cellNode.textContent === "" &&
|
||||
cellNode.content.size === 0 &&
|
||||
cellNode.type.name === "paragraph"
|
||||
) {
|
||||
this.out += " ";
|
||||
} else {
|
||||
this.closed = false;
|
||||
this.render(node, row, j);
|
||||
this.render(cellNode, row, j);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user