mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 03:31:24 +08:00
fix(package): add patch for @tiptap/extension-code to improve regex handling
This commit is contained in:
parent
ed6bfeca77
commit
27ccc25e20
29
.yarn/patches/@tiptap-extension-code-npm-3.7.2-90eeabbd8a.patch
vendored
Normal file
29
.yarn/patches/@tiptap-extension-code-npm-3.7.2-90eeabbd8a.patch
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
diff --git a/dist/index.cjs b/dist/index.cjs
|
||||
index 650402009637c04dce23b2de9baa48b69601f6e7..e4106894f67ff68b78e4e7485b7beb24570f91c0 100644
|
||||
--- a/dist/index.cjs
|
||||
+++ b/dist/index.cjs
|
||||
@@ -29,8 +29,8 @@ module.exports = __toCommonJS(index_exports);
|
||||
|
||||
// src/code.ts
|
||||
var import_core = require("@tiptap/core");
|
||||
-var inputRegex = /(^|[^`])`([^`]+)`(?!`)$/;
|
||||
-var pasteRegex = /(^|[^`])`([^`]+)`(?!`)/g;
|
||||
+var inputRegex = /(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/;
|
||||
+var pasteRegex = /(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g;
|
||||
var Code = import_core.Mark.create({
|
||||
name: "code",
|
||||
addOptions() {
|
||||
diff --git a/dist/index.js b/dist/index.js
|
||||
index 7f9e650a5713377d8d6a824f884bbfe6d27fe519..3736cac514b979438a808705931636ae04b06d16 100644
|
||||
--- a/dist/index.js
|
||||
+++ b/dist/index.js
|
||||
@@ -1,7 +1,7 @@
|
||||
// src/code.ts
|
||||
import { Mark, markInputRule, markPasteRule, mergeAttributes } from "@tiptap/core";
|
||||
-var inputRegex = /(^|[^`])`([^`]+)`(?!`)$/;
|
||||
-var pasteRegex = /(^|[^`])`([^`]+)`(?!`)/g;
|
||||
+var inputRegex = /(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/;
|
||||
+var pasteRegex = /(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g;
|
||||
var Code = Mark.create({
|
||||
name: "code",
|
||||
addOptions() {
|
||||
@ -394,7 +394,8 @@
|
||||
"@img/sharp-linux-arm64": "0.34.3",
|
||||
"@img/sharp-linux-x64": "0.34.3",
|
||||
"@img/sharp-win32-x64": "0.34.3",
|
||||
"openai@npm:5.12.2": "npm:@cherrystudio/openai@6.5.0"
|
||||
"openai@npm:5.12.2": "npm:@cherrystudio/openai@6.5.0",
|
||||
"@tiptap/extension-code@npm:^3.7.2": "patch:@tiptap/extension-code@npm%3A3.7.2#~/.yarn/patches/@tiptap-extension-code-npm-3.7.2-90eeabbd8a.patch"
|
||||
},
|
||||
"packageManager": "yarn@4.9.1",
|
||||
"lint-staged": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user