Skip to content

Commit

Permalink
Mark the page number as 1 if used paginate: hold at beginning
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Sep 9, 2023
1 parent 4149d8a commit d03163b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/markdown/directives/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ function _apply(md, opts = {}) {
marpitDirectives.paginate &&
marpitDirectives.paginate !== 'skip'
) {
// If the page number was still not incremented, mark this page as
// the first page.
if (pageNumber <= 0) pageNumber = 1

token.attrSet('data-marpit-pagination', pageNumber)
tokensForPaginationTotal.push(token)
}
Expand All @@ -118,7 +122,7 @@ function _apply(md, opts = {}) {
}
}

// Set total page number to each slide
// Set total page number to each slide page that has pagination attribute
for (const token of tokensForPaginationTotal) {
token.attrSet('data-marpit-pagination-total', pageNumber)
}
Expand Down

0 comments on commit d03163b

Please sign in to comment.