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

Page break doesn't work with heading or empty line preceding #585

Open
bkaganovich opened this issue May 23, 2022 · 1 comment
Open

Page break doesn't work with heading or empty line preceding #585

bkaganovich opened this issue May 23, 2022 · 1 comment

Comments

@bkaganovich
Copy link

bkaganovich commented May 23, 2022

The page break in PDF export or print preview doesn't work if the line before is a heading or empty line.

Related:
Page break in markdown does not work #290
Can I use page breaks in Markdown?

<!-- Required extensions: attr_list -->

First page

# Doesn't work here
{: style="page-break-before: always" }


{: style="page-break-before: always" }

Doesn't work here either

New page starts here
{: style="page-break-before: always" }

This solution works:

*<!-- -->*
{: style="page-break-before: always" }
@mitya57
Copy link
Member

mitya57 commented May 24, 2022

For headers, you can put the attributes on the same line:

# Header Title {: style="page-break-before: always" }

With empty line, it indeed doesn't work, because you need something to attach the attribute too.

You can also use raw HTML if you really need an empty object:

<div style="page-break-before: always"></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants