File last modified on August 18, 2022

Page Breaks

All ePubs should have a page break if a print edition is being released, example:

html
1
<!-- page 123 -->
2
<a epub:type="pagebreak" id="page123" title="123"></a>

After p

Page breaks that come directly after a <p> tag should be removed and placed on their own line, regex for the BBEdit Find Panel:

bash
1
## Find:
2
([\t]+)<p class="([A-Za-z0-9_-]+)">(<span class="[A-Za-z0-9_-]+">|)<a epub:type="pagebreak" id="page(\d{1,4}|\D{1,6})" title="\4"></a>
3
4
## Replace:
5
\1<a epub:type="pagebreak" id="page\4" title="\4"></a>\r\1<p class="\2">\3

If a page break exists in a <p> tag with nothing else the <p> should be removed:

Before

html
1
<p class="foobar"><a epub:type="pagebreak" id="page10" title="10"></a></p>

After

html
1
<a epub:type="pagebreak" id="page10" title="10"></a>

A page break builder app does exist, pagebreak_builder.app, that will pull all the page breaks from .bbprojectd, format and identify if any are missing.

ON THIS PAGE
Last build: Thursday, 08/18/2022, 01:01:08 AM