diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts index 03177e724..d3e63855b 100644 --- a/app/src/protyle/export/index.ts +++ b/app/src/protyle/export/index.ts @@ -105,8 +105,9 @@ const renderPDF = (id: string) => { position: fixed; right: 0; top: 0; - overflow: auto; + overflow-y: auto; bottom: 0; + overflow-x: hidden; } #preview { @@ -240,6 +241,8 @@ const renderPDF = (id: string) => { const setLineNumberWidth = (element) => { // 为保持代码块宽度一致,全部都进行宽度设定 https://github.com/siyuan-note/siyuan/issues/7692 previewElement.querySelectorAll('.hljs').forEach((item) => { + // 强制换行 https://ld246.com/article/1679228783553 + item.parentElement.setAttribute("linewrap", "true"); item.parentElement.style.width = ""; item.parentElement.style.width = item.parentElement.clientWidth + "px"; item.removeAttribute('data-render'); @@ -248,6 +251,7 @@ const renderPDF = (id: string) => { previewElement.querySelectorAll('[data-type="NodeMathBlock"]').forEach((item) => { item.style.width = ""; item.style.width = item.clientWidth + "px"; + item.removeAttribute('data-render'); }) Protyle.mathRender(previewElement, "${servePath}/stage/protyle", true); }