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

An array is being returned, rather than a content object. #224

Closed
bejhan-rxnt opened this issue Oct 24, 2024 · 2 comments
Closed

An array is being returned, rather than a content object. #224

bejhan-rxnt opened this issue Oct 24, 2024 · 2 comments

Comments

@bejhan-rxnt
Copy link

bejhan-rxnt commented Oct 24, 2024

Provide the HTML code
<strong>Title</strong> <i>Some other text</i><br />This is some text.<br /><ul><li>Test</li><ul><li>Test</li></ul></ul>

Describe the bug
The resulting array of elements is being directly returned rather than being wrapped in an object with a stack property, as the README states.

[
  {
    text: "Title",
    nodeName: "STRONG",
    bold: true,
    style: [
      "html-strong",
    ],
  },
  {
    text: " ",
  },
  {
    text: "Some other text",
    nodeName: "I",
    italics: true,
    style: [
      "html-i",
    ],
  },
  {
    text: "\n",
    nodeName: "BR",
  },
  {
    text: "This is some text.",
  },
  {
    text: "\n",
    nodeName: "BR",
  },
  {
    nodeName: "UL",
    ul: [
      {
        text: "Test",
        nodeName: "LI",
        style: [
          "html-li",
          "html-ul",
        ],
      },
      {
        nodeName: "UL",
        marginBottom: 5,
        marginLeft: 5,
        style: [
          "html-ul",
        ],
        ul: [
          {
            text: "Test",
            nodeName: "LI",
            style: [
              "html-li",
              "html-ul",
            ],
          },
        ],
      },
    ],
    marginBottom: 5,
    marginLeft: 5,
    style: [
      "html-ul",
    ],
  },
]
@Aymkdn
Copy link
Owner

Aymkdn commented Oct 24, 2024

Either way, the PDF should look the same at the end, no?

@Aymkdn Aymkdn added the waiting-for-requestor Waiting for the requestor to provide more info label Oct 24, 2024
@bejhan-rxnt
Copy link
Author

Yes, you're right - it seems PDF make defaults to stack type when it encounters an array.

@github-actions github-actions bot removed the waiting-for-requestor Waiting for the requestor to provide more info label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants