Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve code block paging when exporting to PDF #13349

Closed
Achuan-2 opened this issue Dec 3, 2024 · 2 comments
Closed

Improve code block paging when exporting to PDF #13349

Achuan-2 opened this issue Dec 3, 2024 · 2 comments
Assignees
Milestone

Comments

@Achuan-2
Copy link
Member

Achuan-2 commented Dec 3, 2024

改进导出 PDF 代码块分页的情况

In what scenarios do you need this feature?

PixPin_2024-12-03_12-37-34

代码块导出pdf,会发现如果代码块正好在两页中间,代码块的背景就会比原来的更长一些,就会影响到后面的元素,请问该如何解决

测试文档

代码块导出pdf效果.sy.zip

Describe the optimal solution

希望能解决这个问题,不然很影响导出pdf的效果

Describe the candidate solution

Other information

No response

@Achuan-2
Copy link
Member Author

Achuan-2 commented Dec 3, 2024

发现不能给code-block添加padding,得给hljs加,用下面代码就能解决了

#preview .protyle-wysiwyg .code-block {
    width: 98% !important;
    margin: 1em auto;
    padding: 0px;
}

#preview .protyle-wysiwyg .hljs {
    padding: 2em 1em 0.6em;
}

Vanessa219 added a commit that referenced this issue Dec 4, 2024
@Vanessa219
Copy link
Member

好奇怪,这是为什么?

@Vanessa219 Vanessa219 added this to the 3.1.15 milestone Dec 4, 2024
@Vanessa219 Vanessa219 changed the title 导出pdf时,如果代码块被分页,代码块会被延长,影响后面元素 改进导出 PDF 代码块分页的情况 Dec 4, 2024
@88250 88250 changed the title 改进导出 PDF 代码块分页的情况 Improve code block paging when exporting to PDF Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants