mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 11:49:02 +08:00
fix(RichEditor): remove comment about underline default in useRichEditor
This commit is contained in:
parent
b7d8dff0d3
commit
c2fe2160b5
30
.yarn/patches/@tiptap-markdown-npm-3.7.2-165301ab30.patch
vendored
Normal file
30
.yarn/patches/@tiptap-markdown-npm-3.7.2-165301ab30.patch
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
diff --git a/dist/index.js b/dist/index.js
|
||||
index 09b04baf28c18d8ee20e6d0644329a830915e893..f2b3e8df251c3f56074937dc0c6e658930d5303b 100644
|
||||
--- a/dist/index.js
|
||||
+++ b/dist/index.js
|
||||
@@ -558,14 +558,24 @@ var MarkdownManager = class {
|
||||
nextNode,
|
||||
this.markSetsEqual.bind(this)
|
||||
);
|
||||
+
|
||||
+ // Collect all closing marks with their markdown syntax
|
||||
+ const closingMarks = [];
|
||||
marksToCloseAtEnd.forEach((markType) => {
|
||||
const mark = activeMarks.get(markType);
|
||||
const closeMarkdown = this.getMarkClosing(markType, mark);
|
||||
if (closeMarkdown) {
|
||||
- textContent += closeMarkdown;
|
||||
+ closingMarks.push(closeMarkdown);
|
||||
}
|
||||
activeMarks.delete(markType);
|
||||
});
|
||||
+
|
||||
+ // Reverse the closing marks to match opening order (LIFO)
|
||||
+ // For example: if we opened as *~~, we should close as ~~*
|
||||
+ closingMarks.reverse().forEach((closeMarkdown) => {
|
||||
+ textContent += closeMarkdown;
|
||||
+ });
|
||||
+
|
||||
result.push(textContent);
|
||||
} else {
|
||||
const marksToReopen = new Map(activeMarks);
|
||||
@ -180,7 +180,7 @@
|
||||
"@tiptap/extension-table-of-contents": "^3.7.2",
|
||||
"@tiptap/extension-typography": "^3.7.2",
|
||||
"@tiptap/extension-underline": "^3.7.2",
|
||||
"@tiptap/markdown": "^3.7.2",
|
||||
"@tiptap/markdown": "patch:@tiptap/markdown@npm%3A3.7.2#~/.yarn/patches/@tiptap-markdown-npm-3.7.2-165301ab30.patch",
|
||||
"@tiptap/pm": "^3.7.2",
|
||||
"@tiptap/react": "^3.7.2",
|
||||
"@tiptap/starter-kit": "^3.7.2",
|
||||
|
||||
@ -207,7 +207,6 @@ export const useRichEditor = (options: UseRichEditorOptions = {}): UseRichEditor
|
||||
},
|
||||
codeBlock: false,
|
||||
link: false
|
||||
// underline is enabled by default in StarterKit
|
||||
}),
|
||||
EnhancedLink.configure({
|
||||
onLinkHover: handleLinkHover,
|
||||
|
||||
16
yarn.lock
16
yarn.lock
@ -11881,7 +11881,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@tiptap/markdown@npm:^3.7.2":
|
||||
"@tiptap/markdown@npm:3.7.2":
|
||||
version: 3.7.2
|
||||
resolution: "@tiptap/markdown@npm:3.7.2"
|
||||
dependencies:
|
||||
@ -11893,6 +11893,18 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@tiptap/markdown@patch:@tiptap/markdown@npm%3A3.7.2#~/.yarn/patches/@tiptap-markdown-npm-3.7.2-165301ab30.patch":
|
||||
version: 3.7.2
|
||||
resolution: "@tiptap/markdown@patch:@tiptap/markdown@npm%3A3.7.2#~/.yarn/patches/@tiptap-markdown-npm-3.7.2-165301ab30.patch::version=3.7.2&hash=fe7244"
|
||||
dependencies:
|
||||
marked: "npm:^16.1.2"
|
||||
peerDependencies:
|
||||
"@tiptap/core": ^3.7.2
|
||||
"@tiptap/pm": ^3.7.2
|
||||
checksum: 10c0/e10a12b5bdfdd5efea24e7d089832cd2d3192b6222979c19b130e0eea00df0c498dd79efb5aec18e98d0b05627c81691dec3ab0c86f2a15244690cff1e1515f9
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@tiptap/pm@npm:^3.7.2":
|
||||
version: 3.7.2
|
||||
resolution: "@tiptap/pm@npm:3.7.2"
|
||||
@ -13960,7 +13972,7 @@ __metadata:
|
||||
"@tiptap/extension-table-of-contents": "npm:^3.7.2"
|
||||
"@tiptap/extension-typography": "npm:^3.7.2"
|
||||
"@tiptap/extension-underline": "npm:^3.7.2"
|
||||
"@tiptap/markdown": "npm:^3.7.2"
|
||||
"@tiptap/markdown": "patch:@tiptap/markdown@npm%3A3.7.2#~/.yarn/patches/@tiptap-markdown-npm-3.7.2-165301ab30.patch"
|
||||
"@tiptap/pm": "npm:^3.7.2"
|
||||
"@tiptap/react": "npm:^3.7.2"
|
||||
"@tiptap/starter-kit": "npm:^3.7.2"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user