Skip to content

Commit

Permalink
feat: Handle number list start number in export to pdf, docx
Browse files Browse the repository at this point in the history
  • Loading branch information
mfanselmo committed Jan 7, 2025
1 parent 68ce5b4 commit bb4b001
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,14 @@ export default function App() {
},
{
type: "numberedListItem",
content: "Numbered List Item",
content: "Numbered List Item starting at 10",
props: {
start: 10,
},
},
{
type: "numberedListItem",
content: "Numbered List Item continuing from 10",
},
{
type: "checkListItem",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,14 @@ export default function App() {
},
{
type: "numberedListItem",
content: "Numbered List Item",
content: "Numbered List Item starting at 10",
props: {
start: 10,
},
},
{
type: "numberedListItem",
content: "Numbered List Item continuing from 10",
},
{
type: "checkListItem",
Expand Down
3 changes: 3 additions & 0 deletions packages/xl-pdf-exporter/src/pdf/pdfExporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ export class PDFExporter<
for (const b of blocks) {
if (b.type === "numberedListItem") {
numberedListIndex++;
if (b.props.start !== undefined) {
numberedListIndex = b.props.start as number;
}
} else {
numberedListIndex = 0;
}
Expand Down

0 comments on commit bb4b001

Please sign in to comment.