mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-02 06:48:49 +01:00
This commit is contained in:
parent
3db0b0cf94
commit
eba5808af2
1 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue