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

Unordered lists nested within ordered lists force the remaining ordered list items to use bullets #3440

Open
superheroben opened this issue Apr 17, 2024 · 3 comments
Milestone

Comments

@superheroben
Copy link

Having an issue that whenever an ordered list has a sub unordered list its any of the following ordered list items are no longer numbered but are presented as bullets

example

Here is the HTML that was provided to DOMPDF:

<ol>
   <li>Make sure you're prepared to safely make observations during the eclipse. Never look directly at the Sun without specialized eclipse viewing glasses. Do not point any viewing devices or cameras at the Sun without specially made protective solar film securely attached over the lenses.</li>
   <li>Prepare your materials at least two hours before the eclipse reaches its peak in your area.</li>
      <ul>
          <li><span>Download the&nbsp;</span><a href="https://observer.globe.gov/about/get-the-app" target="_blank"><b>GLOBE Observer app</b></a><span>&nbsp;on your smartphone.</span></li>
          <li><span>Familiarize yourself with the types of data to record, and how to take recordings:&nbsp;</span><a href="https://observer.globe.gov/do-globe-observer/eclipse/taking-observations" target="_blank">https://observer.globe.gov/do-globe-observer/eclipse/taking-observations</a></li>
          <li>Optional: assemble a team! This project will involve taking many data recordings over a span of four hours. Having a team of fellow citizen scientists will make it much easier to collect data.</li>
      </ul>
   <li>Start taking observations two hours before the eclipse reaches its peak, and continue making observations for two hours afterward.</li>
      <ul>
          <li>Cloud type and cover: Record the types of clouds and the overall level of cloud cover every 15-30 minutes.</li>
          <li>Air temperature: Record the air temperature every 10 minutes. Be sure to take your recordings in a shaded area.</li>
      </ul>
   <li>Submit your data!</li>
</ol>
@superheroben
Copy link
Author

Sorry that image should say "Should be 3 and 4"....Not enough coffee today

@bsweeney
Copy link
Member

Indentation is all wonky as well. Seems to be an issue starting with the 2.0.0 release. The 1.2.2 release renders this correctly.

Reviewing the DOM after document ingestion it looks like the rendering difference is caused by the HTML5 parser. It's attempting to clean up the HTML since the document structure is not strictly valid. Your nested lists should be within an LI since LI elements are the only allowed children of OL/UL elements, per the spec.

The following renders as expected:

<ol>
   <li>Make sure you're prepared to safely make observations during the eclipse. Never look directly at the Sun without specialized eclipse viewing glasses. Do not point any viewing devices or cameras at the Sun without specially made protective solar film securely attached over the lenses.</li>
   <li>Prepare your materials at least two hours before the eclipse reaches its peak in your area.
      <ul>
          <li><span>Download the&nbsp;</span><a href="https://observer.globe.gov/about/get-the-app" target="_blank"><b>GLOBE Observer app</b></a><span>&nbsp;on your smartphone.</span></li>
          <li><span>Familiarize yourself with the types of data to record, and how to take recordings:&nbsp;</span><a href="https://observer.globe.gov/do-globe-observer/eclipse/taking-observations" target="_blank">https://observer.globe.gov/do-globe-observer/eclipse/taking-observations</a></li>
          <li>Optional: assemble a team! This project will involve taking many data recordings over a span of four hours. Having a team of fellow citizen scientists will make it much easier to collect data.</li>
      </ul>
      </li>
   <li>Start taking observations two hours before the eclipse reaches its peak, and continue making observations for two hours afterward.
      <ul>
          <li>Cloud type and cover: Record the types of clouds and the overall level of cloud cover every 15-30 minutes.</li>
          <li>Air temperature: Record the air temperature every 10 minutes. Be sure to take your recordings in a shaded area.</li>
      </ul>
      </li>
   <li>Submit your data!</li>
</ol>

This is probably a common enough scenario it's worth further review for improved handling.

@bsweeney bsweeney added this to the 3.0.1 milestone Apr 17, 2024
@superheroben
Copy link
Author

superheroben commented Apr 17, 2024 via email

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