Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/11757

Vanessa9010399d76b9
diff --git a/app/src/protyle/wysiwyg/commonHotkey.ts b/app/src/protyle/wysiwyg/commonHotkey.ts
index 9af51bc754..165fb05cf9 100644
--- a/app/src/protyle/wysiwyg/commonHotkey.ts
+++ b/app/src/protyle/wysiwyg/commonHotkey.ts
@@ -320,6 +320,7 @@ export const alignImgLeft = (protyle: IProtyle, nodeElement: Element, assetEleme
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
assetElements.forEach((item: HTMLElement) => {
item.style.minWidth = "";
+ // 兼容历史居中问题
item.style.display = "";
});
updateTransaction(protyle, id, nodeElement.outerHTML, html);
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 4d778d5ac9..a125daefeb 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -630,7 +630,7 @@ export class WYSIWYG {
dragElement.parentElement.parentElement.style.width = "";
}
if (moveEvent.clientX > x - dragWidth + 8 && moveEvent.clientX < mostRight) {
- if ((dragElement.tagName === "IMG" && dragElement.parentElement.parentElement.style.display !== "block") || !isCenter) {
+ if ((dragElement.tagName === "IMG" && !dragElement.parentElement.parentElement.style.minWidth) || !isCenter) {
dragElement.style.width = Math.max(17, dragWidth + (moveEvent.clientX - x)) + "px";
} else {
dragElement.style.width = Math.max(17, dragWidth + (moveEvent.clientX - x) * 2) + "px";