Skip to content

Fix nested lists and allow list style attribute #198

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

Merged
merged 1 commit into from
Apr 15, 2025

Conversation

Tranquilite0
Copy link
Contributor

Two fixes here:

The first is that nested ordered lists which changed to a different style would not reset numbering. eg:

  1. 1
  2. 2
    a. a
    b. b
  3. 3
    a. a
    b. b

Would be put in the openxml as:

  1. 1
  2. 2
    a. a
    b. b
  3. 3
    c. a
    d. b

Note how the nested alpha list does not reset numbering. The fix was just to reorder the if/else statements to give priority to restarting nested lists.

The second fix was support of the "type" attribute for the <ol type="1|a|A|i|I"> tag (https://www.w3schools.com/tags/att_ol_type.asp).
I had some html which uses the type attribute rather than set the style="list-style-type" attribute.

Fix nested ordered lists which change type not restarting (e.g. nesting a lower-alpha list in a decimal list would not restart the numbering).
Added support for parsing the <ol type="1|a|A|i|I">  attribute.
Copy link

sonarqubecloud bot commented Apr 4, 2025

@onizet onizet merged commit 1a14761 into onizet:dev Apr 15, 2025
1 of 3 checks passed
@onizet
Copy link
Owner

onizet commented Apr 15, 2025

Just reviewed and did some quick tests. Looks good to me, thank you!

@onizet onizet mentioned this pull request Apr 24, 2025
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.

2 participants