This commit is contained in:
Vanessa 2025-10-27 17:36:29 +08:00
parent 5e4915a512
commit a9351cc4eb
3 changed files with 2 additions and 3 deletions

View file

@ -16,7 +16,6 @@ import {focusByOffset, focusByRange, getSelectionOffset} from "../protyle/util/s
import {hideElements} from "../protyle/ui/hideElements"; import {hideElements} from "../protyle/ui/hideElements";
import {fetchPost} from "../util/fetch"; import {fetchPost} from "../util/fetch";
import {hasClosestBlock, hasClosestByClassName} from "../protyle/util/hasClosest"; import {hasClosestBlock, hasClosestByClassName} from "../protyle/util/hasClosest";
import {getContenteditableElement} from "../protyle/wysiwyg/getBlock";
import {Constants} from "../constants"; import {Constants} from "../constants";
import {saveScroll} from "../protyle/scroll/saveScroll"; import {saveScroll} from "../protyle/scroll/saveScroll";
import {Backlink} from "./dock/Backlink"; import {Backlink} from "./dock/Backlink";

View file

@ -669,7 +669,7 @@ export const onExport = async (data: IWebSocketData, filePath: string, exportOpt
if (!isDefault) { if (!isDefault) {
themeStyle = `<link rel="stylesheet" type="text/css" id="themeStyle" href="${servePath}appearance/themes/${themeName}/theme.css?${Constants.SIYUAN_VERSION}"/>`; themeStyle = `<link rel="stylesheet" type="text/css" id="themeStyle" href="${servePath}appearance/themes/${themeName}/theme.css?${Constants.SIYUAN_VERSION}"/>`;
} }
let screenWidth = getScreenWidth(); const screenWidth = getScreenWidth();
const minWidthHtml = isInAndroid() || isInHarmony() ? `document.body.style.minWidth = "${screenWidth}px"` : ""; const minWidthHtml = isInAndroid() || isInHarmony() ? `document.body.style.minWidth = "${screenWidth}px"` : "";
const html = `<!DOCTYPE html> const html = `<!DOCTYPE html>
<html lang="${window.siyuan.config.appearance.lang}" data-theme-mode="${getThemeMode()}" data-light-theme="${window.siyuan.config.appearance.themeLight}" data-dark-theme="${window.siyuan.config.appearance.themeDark}"> <html lang="${window.siyuan.config.appearance.lang}" data-theme-mode="${getThemeMode()}" data-light-theme="${window.siyuan.config.appearance.themeLight}" data-dark-theme="${window.siyuan.config.appearance.themeDark}">

View file

@ -3036,7 +3036,7 @@ export class WYSIWYG {
let newRange = getEditorRange(this.element); let newRange = getEditorRange(this.element);
// 点击两侧或间隙导致光标跳转到开头 https://github.com/siyuan-note/siyuan/issues/16179 // 点击两侧或间隙导致光标跳转到开头 https://github.com/siyuan-note/siyuan/issues/16179
if (hasClosestBlock(event.target) !== hasClosestBlock(newRange.startContainer) && if (hasClosestBlock(event.target) !== hasClosestBlock(newRange.startContainer) &&
this.element.querySelector('[data-node-id]')?.contains(newRange.startContainer)) { this.element.querySelector("[data-node-id]")?.contains(newRange.startContainer)) {
const rect = this.element.getBoundingClientRect(); const rect = this.element.getBoundingClientRect();
let rangeElement = document.elementFromPoint(rect.left + rect.width / 2, event.clientY); let rangeElement = document.elementFromPoint(rect.left + rect.width / 2, event.clientY);
if (rangeElement === this.element) { if (rangeElement === this.element) {