🎨 Improve exporting document HTML (#16219)

* 🎨 The browser-side supports exporting document HTML

fix https://github.com/siyuan-note/siyuan/issues/16213

* 修复导出 HTML 时引入资源没有使用相对路径,修复文档导出 HTML/PDF 时缺失图标

fix https://github.com/siyuan-note/siyuan/issues/16217

fix https://github.com/siyuan-note/siyuan/issues/16216 01

* 修复文档导出 HTML/PDF 时冗余图标

fix https://github.com/siyuan-note/siyuan/issues/16216 02
This commit is contained in:
Jeffrey Chen 2025-10-28 09:28:56 +08:00 committed by GitHub
parent bca1f1eda6
commit 90a447f914
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 241 additions and 40 deletions

View file

@ -198,7 +198,7 @@ export const initAssets = () => {
});
};
export const setInlineStyle = async (set = true, servePath = "../../..") => {
export const setInlineStyle = async (set = true, servePath = "../../../") => {
const height = Math.floor(window.siyuan.config.editor.fontSize * 1.625);
let style;
// Emojis Reset: 字体中包含了 emoji需重置
@ -206,7 +206,7 @@ export const setInlineStyle = async (set = true, servePath = "../../..") => {
if (isMac() || isIPad() || isIPhone()) {
style = `@font-face {
font-family: "Emojis Additional";
src: url(${servePath}/appearance/fonts/Noto-COLRv1-2.047/Noto-COLRv1.woff2) format("woff2");
src: url(${servePath}appearance/fonts/Noto-COLRv1-2.047/Noto-COLRv1.woff2) format("woff2");
unicode-range: U+1fae9, U+1fac6, U+1fabe, U+1fadc, U+e50a, U+1fa89, U+1fadf, U+1f1e6-1f1ff, U+1fa8f;
}
@font-face {
@ -232,7 +232,7 @@ export const setInlineStyle = async (set = true, servePath = "../../..") => {
if (isWin11Browser) {
style = `@font-face {
font-family: "Emojis Additional";
src: url(${servePath}/appearance/fonts/Noto-COLRv1-2.047/Noto-COLRv1.woff2) format("woff2");
src: url(${servePath}appearance/fonts/Noto-COLRv1-2.047/Noto-COLRv1.woff2) format("woff2");
unicode-range: U+1fae9, U+1fac6, U+1fabe, U+1fadc, U+e50a, U+1fa89, U+1fadf, U+1f1e6-1f1ff, U+1f3f4, U+e0067, U+e0062,
U+e0065, U+e006e, U+e007f, U+e0073, U+e0063, U+e0074, U+e0077, U+e006c;
size-adjust: 85%;
@ -254,7 +254,7 @@ export const setInlineStyle = async (set = true, servePath = "../../..") => {
} else {
style = `@font-face {
font-family: "Emojis Reset";
src: url(${servePath}/appearance/fonts/Noto-COLRv1-2.047/Noto-COLRv1.woff2) format("woff2");
src: url(${servePath}appearance/fonts/Noto-COLRv1-2.047/Noto-COLRv1.woff2) format("woff2");
unicode-range: U+1f170-1f171, U+1f17e, U+1f17f, U+1f21a, U+1f22f, U+1f232-1f23a, U+1f250, U+1f251, U+1f32b, U+1f3bc,
U+1f411, U+1f42d, U+1f42e, U+1f431, U+1f435, U+1f441, U+1f4a8, U+1f4ab, U+1f525, U+1f600-1f60d, U+1f60f-1f623,
U+1f625-1f62b, U+1f62d-1f63f, U+1F643, U+1F640, U+1f79, U+1f8f, U+1fa79, U+1fae4, U+1fae9, U+1fac6, U+1fabe, U+1fadf,
@ -267,7 +267,7 @@ export const setInlineStyle = async (set = true, servePath = "../../..") => {
}
@font-face {
font-family: "Emojis";
src: url(${servePath}/appearance/fonts/Noto-COLRv1-2.047/Noto-COLRv1.woff2) format("woff2"),
src: url(${servePath}appearance/fonts/Noto-COLRv1-2.047/Noto-COLRv1.woff2) format("woff2"),
local("Segoe UI Emoji"),
local("Segoe UI Symbol"),
local("Apple Color Emoji"),