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

Nested Ordered Lists #2582

Closed
SawkaDev opened this issue May 4, 2023 · 4 comments
Closed

Nested Ordered Lists #2582

SawkaDev opened this issue May 4, 2023 · 4 comments

Comments

@SawkaDev
Copy link

SawkaDev commented May 4, 2023

Given the following dd

// playground requires you to assign document definition to a variable called dd

var dd = {
  "content": [
    {
      "ol": [
        {
          "text": "ordere list one"
        },
        {
          "ol": [
            {
              "text": "nested"
            },
            {
              "text": "nested again"
            },
            {
              "ol": [
                {
                  "text": "double nested"
                }
              ]
            }
          ]
        },
        {
          "text": "ordered list two"
        }
      ]
    }
  ]
}

Produces the following numbering

image

Is this expected? Is my dd incorrect in some way?

@SawkaDev
Copy link
Author

I still have yet to figure this out. I am unable to find any solution. Any thoughts?

@SawkaDev
Copy link
Author

SawkaDev commented Dec 1, 2023

any updates on this?

@fe-cj
Copy link
Contributor

fe-cj commented Jul 28, 2024

You can wrap a list item and the subsequent nested list in an array:

var dd = {
  "content": [
    {
      "ol": [
        [
            {
              "text": "ordere list one"
            },
            {
              "ol": [
                {
                  "text": "nested"
                },
                [
                    {
                      "text": "nested again"
                    },
                    {
                      "ol": [
                        {
                          "text": "double nested"
                        }
                      ]
                    }
                ]
              ]
            }
        ],
        {
          "text": "ordered list two"
        }
      ]
    }
  ]
}

image

fe-cj added a commit to fe-cj/pdfmake that referenced this issue Jul 29, 2024
liborm85 added a commit that referenced this issue Jul 30, 2024
@liborm85
Copy link
Collaborator

liborm85 commented Aug 9, 2024

Fixed by PR #2760.
Released in version 0.2.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants