mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Convert break-*: page to break-*: column
`break-*` is the newer standard that replaced the legacy `page-break-*` properties. Note that setting it to `always` or `all` does not work. There seems to be no way of telling browsers to break in both paged media and multicol.
This commit is contained in:
@@ -735,8 +735,10 @@ class Loader {
|
|||||||
.replace(/(\d*\.?\d+)vw/gi, (_, d) => parseFloat(d) * w / 100 + 'px')
|
.replace(/(\d*\.?\d+)vw/gi, (_, d) => parseFloat(d) * w / 100 + 'px')
|
||||||
.replace(/(\d*\.?\d+)vh/gi, (_, d) => parseFloat(d) * h / 100 + 'px')
|
.replace(/(\d*\.?\d+)vh/gi, (_, d) => parseFloat(d) * h / 100 + 'px')
|
||||||
// `page-break-*` unsupported in columns; replace with `column-break-*`
|
// `page-break-*` unsupported in columns; replace with `column-break-*`
|
||||||
.replace(/page-break-(after|before|inside)/gi, (_, x) =>
|
.replace(/page-break-(after|before|inside)\s*:/gi, (_, x) =>
|
||||||
`-webkit-column-break-${x}`)
|
`-webkit-column-break-${x}:`)
|
||||||
|
.replace(/break-(after|before|inside)\s*:\s*(avoid-)?page/gi, (_, x, y) =>
|
||||||
|
`break-${x}: ${y ?? ''}column`)
|
||||||
}
|
}
|
||||||
// find & replace all possible relative paths for all assets without parsing
|
// find & replace all possible relative paths for all assets without parsing
|
||||||
replaceString(str, href, parents = []) {
|
replaceString(str, href, parents = []) {
|
||||||
|
|||||||
Reference in New Issue
Block a user