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

Upgrade paged.js to v0.4.3 #692

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/document/document-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class DocumentPDFConverter {
this.linkStylesheet = /(<link rel="stylesheet"[^>]*\/>)/g
this.stemContent = require('./stem')
this.repeatTableElementsContent = fs.readFileSync(ospath.join(__dirname, 'repeating-table-elements.js'), 'utf8')
this.pagedContent = fs.readFileSync(require.resolve('@ggrossetie/pagedjs/dist/paged.polyfill.js'), 'utf8')
markduan marked this conversation as resolved.
Show resolved Hide resolved
this.pagedContent = fs.readFileSync(ospath.join(__dirname, '../../node_modules/pagedjs/dist/paged.polyfill.js'), 'utf8')
this.pagedRendering = fs.readFileSync(`${__dirname}/paged-rendering.js`, 'utf8')
const stylesDirectoryPath = ospath.resolve(`${__dirname}/../../css`)
this.asciidoctorStyleContent = fs.readFileSync(`${stylesDirectoryPath}/asciidoctor.css`, 'utf8')
Expand Down
2 changes: 1 addition & 1 deletion lib/document/repeating-table-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RepeatingTableElements extends Paged.Handler {
// Remove orphaned table headers at page breaks
const fromTables = pageElement.querySelectorAll('table:not([data-split-from])')
fromTables.forEach((table) => {
if (table.getElementsByTagName('tbody')[0].children.length === 0) {
if (table.getElementsByTagName('tbody')[0]?.children.length === 0) {
table.parentNode.removeChild(table)
}
})
Expand Down
90 changes: 51 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
"@fortawesome/free-brands-svg-icons": "6.2.1",
"@fortawesome/free-regular-svg-icons": "6.2.1",
"@fortawesome/free-solid-svg-icons": "6.2.1",
"@ggrossetie/pagedjs": "0.2.0-next.1623590414",
"chokidar": "~3.5",
"file-url": "~3.0",
"fs-extra": "~11.1.0",
"html-entities": "~2.3",
"mathjax": "3.2.2",
"pagedjs": "^0.4.3",
"pdf-lib": "~1.17",
"puppeteer": "15.4.0",
"yargs": "17.6.2"
Expand Down