This commit is contained in:
parent
2d348be542
commit
c73d606fb6
1 changed files with 5 additions and 1 deletions
|
@ -304,7 +304,11 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
|
|||
try {
|
||||
// * _ [ ] ! \ ` < > & ~ { } ( ) = # $ ^ |
|
||||
let clipText = await navigator.clipboard.readText();
|
||||
clipText = clipText.replace(/\*/g, "\\*").replace(/\_/g, "\\_").replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\!/g, "\\!").replace(/\`/g, "\\`").replace(/\</g, "\\<").replace(/\>/g, "\\>").replace(/\&/g, "\\&").replace(/\~/g, "\\~").replace(/\{/g, "\\{").replace(/\}/g, "\\}").replace(/\(/g, "\\(").replace(/\)/g, "\\)").replace(/\=/g, "\\=").replace(/\#/g, "\\#").replace(/\$/g, "\\$").replace(/\^/g, "\\^").replace(/\|/g, "\\|") .replace(/\\/g, "\\\\");
|
||||
// https://github.com/siyuan-note/siyuan/issues/5446
|
||||
// A\B\C\D\
|
||||
// E
|
||||
// task-blog-2~default~baiduj https://github.com/siyuan-note/siyuan/issues/5523
|
||||
clipText = clipText.replace(/\\/g, "\\\\").replace(/\*/g, "\\*").replace(/\_/g, "\\_").replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\!/g, "\\!").replace(/\`/g, "\\`").replace(/\</g, "\\<").replace(/\>/g, "\\>").replace(/\&/g, "\\&").replace(/\~/g, "\\~").replace(/\{/g, "\\{").replace(/\}/g, "\\}").replace(/\(/g, "\\(").replace(/\)/g, "\\)").replace(/\=/g, "\\=").replace(/\#/g, "\\#").replace(/\$/g, "\\$").replace(/\^/g, "\\^").replace(/\|/g, "\\|");
|
||||
pasteText(protyle, clipText, nodeElement);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
|
|
Loading…
Add table
Reference in a new issue