Skip to content

Nested lists - Lists can directly contain another list - #42

Open
mato7d5 wants to merge 2 commits into
itext:developfrom
mato7d5:nested_lists
Open

Nested lists - Lists can directly contain another list#42
mato7d5 wants to merge 2 commits into
itext:developfrom
mato7d5:nested_lists

Conversation

@mato7d5

@mato7d5 mato7d5 commented Jul 22, 2026

Copy link
Copy Markdown

These changes add support for nested lists: List into List. The specs enables insert on List into another List and I needed this behavior in our project. Currently the List can be nested into another list via ListItem which adds extra tags (L -> LI -> L). This enables L -> L.

@iText-CI

iText-CI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@vitali-pr

Copy link
Copy Markdown
Contributor

Hi @mato7d5 ,
Thank you for your contribution!

Would you mind signing the Contributor License Agreement?
The details are available at https://itextpdf.com/en/how-buy/legal/itext-contributor-license-agreement
We need it in order to be able to merge your PR.

Next to that, it would be great if you add some tests into itext.layout.tests project.

@mato7d5

mato7d5 commented Jul 23, 2026

Copy link
Copy Markdown
Author

Hi @vitali-pr

done - signed and sent CLA + I've added the unit test.

@vitali-pr

Copy link
Copy Markdown
Contributor

Hi @mato7d5 ,
I had a closer look at your PR and have some questions/remarks on the use case.

  1. We follow PDF/UA spec by default when it comes to tagging. And it says "Individual list items shall be specified by LI tags. Lbl and LBody tags may be included.". It does not directly violates your desire though.
  2. What is the purpose of having L inside L? I think such structure is ambiguous for screen readers if inner L does not belong to any LI.
  3. We have quite wide abilities to customize tags. Could you attach a sample document with the desired tag structure? I could come up with some solution for that based on the current API.

@vitali-pr

Copy link
Copy Markdown
Contributor

Is it somewhat you need?
nestedListTest01.pdf

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

Successfully merging this pull request may close these issues.

3 participants