mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-09 04:02:13 +08:00
This commit is contained in:
parent
314a06d0c8
commit
3d721faa79
@ -669,7 +669,10 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
||||
iconHTML: "",
|
||||
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) {
|
||||
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, "");
|
||||
imgElement.setAttribute("src", value);
|
||||
imgElement.setAttribute("data-src", value);
|
||||
|
Loading…
Reference in New Issue
Block a user