Skip to content

Commit f43592f

Browse files
authored
Merge pull request #170 from marcbachmann/replace-{{page}}-globally
Replace multiple occurences of {{page}} and {{pages}}
2 parents a5cb257 + e853f69 commit f43592f

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)