CSS "break-before: always" Ignored

Viewed 28

It appears that CSS "h2 { break-before: always }" is being ignored in Marked 3, at least as rendered in Print Preview.

2 Answers

Do you mean in a custom style? The PDF/print preview no longer uses WebKit's print system, so is not affected by most webkit CSS rules. That said, it should recognize page-break-before. If you want to share an example document and your custom style, I can test.

It's a custom stylesheet.

To help you debug the issue I'll attach:

  1. A screenshot of the first page
  2. A screenshot of the style management dialog
  3. A screenshot of the Print Preview rendering
  4. A snippet of my Markdown file (the whole thing is 344KB)
  5. My complete CSS file

The CSS indicates that there should be a page break before each of the H2 headings, such as "Apple Cider-Sage Vinaigrette" and "Apple Crisp".

On-Screen View

Style Management

Print Preview

Cookbook Snippet.md

Cookbook.css