Skip to content

Commit e853f69

Browse files
committed
Replace {{page}} and {{pages}} placeholders globally in header & footer
This fixes #161
1 parent 40f7b34 commit e853f69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/scripts/pdf_a4_portrait.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ function createSection (section, content, options) {
156156
if (pageNum === 1 && !html) html = o.first || c.first
157157
if (pageNum === numPages && !html) html = o.last || c.last
158158
return (html || o.default || c.default || '')
159-
.replace('{{page}}', pageNum)
160-
.replace('{{pages}}', numPages) + content.styles
159+
.replace(/{{page}}/g, pageNum)
160+
.replace(/{{pages}}/g, numPages) + content.styles
161161
})
162162
}
163163
}

0 commit comments

Comments
 (0)