mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 01:21:08 +08:00
This commit is contained in:
parent
b3326e9757
commit
053e03ed53
@ -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();
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user