retext icon indicating copy to clipboard operation
retext copied to clipboard

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

Open bkaganovich opened this issue 3 years ago • 1 comments

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" }

bkaganovich avatar May 23 '22 20:05 bkaganovich

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>

mitya57 avatar May 24 '22 11:05 mitya57