From 053e03ed536d0ce1657126fb8dc2520cd6516379 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 17 Dec 2024 20:03:37 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/13497 --- app/src/menus/protyle.ts | 6 +++--- app/src/util/assets.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index e5743b9e5..b4cb02f93 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -1027,7 +1027,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme element.style.maxWidth = "none"; const textElements = element.querySelectorAll("textarea"); textElements[0].addEventListener("input", (event: InputEvent) => { - const value = (event.target as HTMLInputElement).value.replace(/\n|\r\n|\r|\u2028|\u2029/g, ""); + const value = (event.target as HTMLInputElement).value.replace(/\n|\r\n|\r|\u2028|\u2029/g, "").trim(); imgElement.setAttribute("src", value); imgElement.setAttribute("data-src", value); if (value.startsWith("assets/")) { @@ -1854,7 +1854,7 @@ export const iframeMenu = (protyle: IProtyle, nodeElement: Element) => { bind(element) { element.style.maxWidth = "none"; element.querySelector("textarea").addEventListener("change", (event) => { - const value = (event.target as HTMLTextAreaElement).value.replace(/\n|\r\n|\r|\u2028|\u2029/g, ""); + const value = (event.target as HTMLTextAreaElement).value.replace(/\n|\r\n|\r|\u2028|\u2029/g, "").trim(); const biliMatch = value.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/); if (value.indexOf("bilibili.com") > -1 && (value.indexOf("bvid=") > -1 || (biliMatch && biliMatch[1]))) { const params: IObject = { @@ -1925,7 +1925,7 @@ export const videoMenu = (protyle: IProtyle, nodeElement: Element, type: string) bind(element) { element.style.maxWidth = "none"; element.querySelector("textarea").addEventListener("change", (event) => { - videoElement.setAttribute("src", (event.target as HTMLTextAreaElement).value.replace(/\n|\r\n|\r|\u2028|\u2029/g, "")); + videoElement.setAttribute("src", (event.target as HTMLTextAreaElement).value.replace(/\n|\r\n|\r|\u2028|\u2029/g, "").trim()); updateTransaction(protyle, id, nodeElement.outerHTML, html); html = nodeElement.outerHTML; event.stopPropagation(); diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts index cf088f015..712d0b814 100644 --- a/app/src/util/assets.ts +++ b/app/src/util/assets.ts @@ -217,7 +217,7 @@ export const setInlineStyle = (set = true) => { local("Segoe UI Symbol"); unicode-range: U+263a, U+1fae4, U+2194-2199, U+2934-2935, U+25b6, U+25c0, U+23cf, U+2640, U+2642, U+2611, U+303d, U+3030, U+00a9, U+00ae, U+2122, U+1f170, U+1f171, U+24c2, U+1f17e, U+1f17f, U+1f250, U+1f21a, U+1f22f, U+1f232-1f23a, - U+1f251, U+3297, U+3299, U+2639; + U+1f251, U+3297, U+3299, U+2639, U+2660, U+2666, U+2665, U+2663; } @font-face { font-family: "Emojis";