Skip to content

Commit eaa0644

Browse files
committed
resolve: #1462
1 parent c02067b commit eaa0644

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/extras/editor/markdownPaste.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ function getMarkdown(clipboardData: DataTransfer) {
141141
/`[^`]+`/, // Inline code: `code`
142142
/^> /m, // Blockquotes: Lines starting with >
143143
/```/, // Code blocks: Triple backticks
144+
/\*\*[^*]+\*\*/, // Bold: **text**
145+
/\*[^*]+\*/, // Italic: *text*
146+
/__[^_]+__/, // Bold: __text__
147+
/_[^_]+_/, // Italic: _text_
148+
/~~[^~]+~~/, // Strikethrough: ~~text~~
149+
/\^[^^]+\^/, // Superscript: ^text^
150+
/~[^~]+~/, // Subscript: ~text~
151+
/\$\$[\s\S]*?\$\$/, // Block math: $$...$$
152+
/\$[^$\n]+\$/, // Inline math: $...$
144153
];
145154

146155
for (const pattern of markdownPatterns) {

0 commit comments

Comments
 (0)