mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
This commit is contained in:
parent
314a06d0c8
commit
3d721faa79
1 changed files with 4 additions and 1 deletions
|
|
@ -669,7 +669,10 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
||||||
iconHTML: "",
|
iconHTML: "",
|
||||||
label: `<textarea style="margin: 4px 0" rows="1" class="b3-text-field fn__size200" placeholder="${window.siyuan.languages.imageURL}">${imgElement.getAttribute("src")}</textarea>`,
|
label: `<textarea style="margin: 4px 0" rows="1" class="b3-text-field fn__size200" placeholder="${window.siyuan.languages.imageURL}">${imgElement.getAttribute("src")}</textarea>`,
|
||||||
bind(element) {
|
bind(element) {
|
||||||
element.querySelector("textarea").addEventListener("change", (event) => {
|
element.querySelector("textarea").addEventListener("input", (event:InputEvent) => {
|
||||||
|
if (event.isComposing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
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, "");
|
||||||
imgElement.setAttribute("src", value);
|
imgElement.setAttribute("src", value);
|
||||||
imgElement.setAttribute("data-src", value);
|
imgElement.setAttribute("data-src", value);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue