This commit is contained in:
1 parent
a0b52cee63
commit
802630b74c
2 files changed
+4
No files matched your search
@@ -43,6 +43,7 @@ function getImageDecorations(view: EditorView) {
|
||||
syntaxTree(state).iterate({
|
||||
from,
|
||||
to,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
enter: (node: any) => {
|
||||
if (node.name === 'Image') {
|
||||
// 查找图片语法中的 URL 节点
|
||||
|
||||
@@ -76,6 +76,7 @@ export function formatMarkdownTable(tableStr: string): string {
|
||||
|
||||
export const tableFormatterPlugin = ViewPlugin.fromClass(
|
||||
class {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
lastTableRange: any = null;
|
||||
|
||||
constructor(view: EditorView) {
|
||||
@@ -110,11 +111,13 @@ export const tableFormatterPlugin = ViewPlugin.fromClass(
|
||||
const state = view.state;
|
||||
const pos = state.selection.main.head;
|
||||
const tree = syntaxTree(state);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let tableRange: any = null;
|
||||
|
||||
tree.iterate({
|
||||
from: pos,
|
||||
to: pos,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
enter: (node: any) => {
|
||||
if (node.name === 'Table') {
|
||||
tableRange = { from: node.from, to: node.to };
|
||||
|
||||
Reference in new issue
Block a user