fix(editor): eslint useless escape (#9345)
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
/* oxlint-disable no-useless-escape */
|
|
||||||
import type { BlockComponent, ExtensionType } from '@blocksuite/block-std';
|
import type { BlockComponent, ExtensionType } from '@blocksuite/block-std';
|
||||||
import {
|
import {
|
||||||
KEYBOARD_ALLOW_DEFAULT,
|
KEYBOARD_ALLOW_DEFAULT,
|
||||||
@@ -16,7 +15,7 @@ import { InlineMarkdownExtension } from '../../extension/markdown-matcher.js';
|
|||||||
|
|
||||||
export const BoldItalicMarkdown = InlineMarkdownExtension({
|
export const BoldItalicMarkdown = InlineMarkdownExtension({
|
||||||
name: 'bolditalic',
|
name: 'bolditalic',
|
||||||
pattern: /(?:\*\*\*)([^\s\*](?:[^*]*?[^\s\*])?)(?:\*\*\*)$/g,
|
pattern: /(?:\*\*\*)([^\s*](?:[^*]*?[^\s*])?)(?:\*\*\*)$/g,
|
||||||
action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => {
|
action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => {
|
||||||
const match = pattern.exec(prefixText);
|
const match = pattern.exec(prefixText);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
@@ -75,7 +74,7 @@ export const BoldItalicMarkdown = InlineMarkdownExtension({
|
|||||||
|
|
||||||
export const BoldMarkdown = InlineMarkdownExtension({
|
export const BoldMarkdown = InlineMarkdownExtension({
|
||||||
name: 'bold',
|
name: 'bold',
|
||||||
pattern: /(?:\*\*)([^\s\*](?:[^*]*?[^\s\*])?)(?:\*\*)$/g,
|
pattern: /(?:\*\*)([^\s*](?:[^*]*?[^\s*])?)(?:\*\*)$/g,
|
||||||
action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => {
|
action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => {
|
||||||
const match = pattern.exec(prefixText);
|
const match = pattern.exec(prefixText);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
@@ -132,7 +131,7 @@ export const BoldMarkdown = InlineMarkdownExtension({
|
|||||||
|
|
||||||
export const ItalicExtension = InlineMarkdownExtension({
|
export const ItalicExtension = InlineMarkdownExtension({
|
||||||
name: 'italic',
|
name: 'italic',
|
||||||
pattern: /(?:\*)([^\s\*](?:[^*]*?[^\s\*])?)(?:\*)$/g,
|
pattern: /(?:\*)([^\s*](?:[^*]*?[^\s*])?)(?:\*)$/g,
|
||||||
action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => {
|
action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => {
|
||||||
const match = pattern.exec(prefixText);
|
const match = pattern.exec(prefixText);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
@@ -425,7 +424,7 @@ export const LatexExtension = InlineMarkdownExtension({
|
|||||||
name: 'latex',
|
name: 'latex',
|
||||||
|
|
||||||
pattern:
|
pattern:
|
||||||
/(?:\$\$)(?<content>[^\$]+)(?:\$\$)$|(?<blockPrefix>\$\$\$\$)|(?<inlinePrefix>\$\$)$/g,
|
/(?:\$\$)(?<content>[^$]+)(?:\$\$)$|(?<blockPrefix>\$\$\$\$)|(?<inlinePrefix>\$\$)$/g,
|
||||||
action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => {
|
action: ({ inlineEditor, prefixText, inlineRange, pattern, undoManager }) => {
|
||||||
const match = pattern.exec(prefixText);
|
const match = pattern.exec(prefixText);
|
||||||
if (!match || !match.groups) {
|
if (!match || !match.groups) {
|
||||||
|
|||||||
Reference in New Issue
Block a user