From fe957e317556bd9507178c61be5f7bab946a6c00 Mon Sep 17 00:00:00 2001 From: doodlewind <7312949+doodlewind@users.noreply.github.com> Date: Thu, 26 Dec 2024 11:09:30 +0000 Subject: [PATCH] fix(editor): eslint useless escape (#9345) --- .../components/src/rich-text/inline/presets/markdown.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/blocksuite/affine/components/src/rich-text/inline/presets/markdown.ts b/blocksuite/affine/components/src/rich-text/inline/presets/markdown.ts index aff1f63ccf..bf631e21fe 100644 --- a/blocksuite/affine/components/src/rich-text/inline/presets/markdown.ts +++ b/blocksuite/affine/components/src/rich-text/inline/presets/markdown.ts @@ -1,4 +1,3 @@ -/* oxlint-disable no-useless-escape */ import type { BlockComponent, ExtensionType } from '@blocksuite/block-std'; import { KEYBOARD_ALLOW_DEFAULT, @@ -16,7 +15,7 @@ import { InlineMarkdownExtension } from '../../extension/markdown-matcher.js'; export const BoldItalicMarkdown = InlineMarkdownExtension({ name: 'bolditalic', - pattern: /(?:\*\*\*)([^\s\*](?:[^*]*?[^\s\*])?)(?:\*\*\*)$/g, + pattern: /(?:\*\*\*)([^\s*](?:[^*]*?[^\s*])?)(?:\*\*\*)$/g, action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => { const match = pattern.exec(prefixText); if (!match) { @@ -75,7 +74,7 @@ export const BoldItalicMarkdown = InlineMarkdownExtension({ export const BoldMarkdown = InlineMarkdownExtension({ name: 'bold', - pattern: /(?:\*\*)([^\s\*](?:[^*]*?[^\s\*])?)(?:\*\*)$/g, + pattern: /(?:\*\*)([^\s*](?:[^*]*?[^\s*])?)(?:\*\*)$/g, action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => { const match = pattern.exec(prefixText); if (!match) { @@ -132,7 +131,7 @@ export const BoldMarkdown = InlineMarkdownExtension({ export const ItalicExtension = InlineMarkdownExtension({ name: 'italic', - pattern: /(?:\*)([^\s\*](?:[^*]*?[^\s\*])?)(?:\*)$/g, + pattern: /(?:\*)([^\s*](?:[^*]*?[^\s*])?)(?:\*)$/g, action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => { const match = pattern.exec(prefixText); if (!match) { @@ -425,7 +424,7 @@ export const LatexExtension = InlineMarkdownExtension({ name: 'latex', pattern: - /(?:\$\$)(?[^\$]+)(?:\$\$)$|(?\$\$\$\$)|(?\$\$)$/g, + /(?:\$\$)(?[^$]+)(?:\$\$)$|(?\$\$\$\$)|(?\$\$)$/g, action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => { const match = pattern.exec(prefixText); if (!match || !match.groups) {