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

Page break on <li> or at least on nested <ol> or <ul> #18

Open
marcelgolias opened this issue Feb 8, 2023 · 0 comments
Open

Page break on <li> or at least on nested <ol> or <ul> #18

marcelgolias opened this issue Feb 8, 2023 · 0 comments

Comments

@marcelgolias
Copy link

Would it please be possible to modify the script so that there could be a page break even for nested <ol> or <ul> elements?
For example:
<ul>
<li></li>
<li>
<p></p>
<div>
<ol>
<li></li>
<li></li>
</ol>
</div>
</li>
</ul>
Now when I have some long text with bullets (ol/ul) that are nested inside other bullets, the page doesn't break properly, or I have unnecessarily long spaces there.
I tried to add li inside your script like this:
snippets = pages[p].querySelectorAll("h1, h2, h3, h4, h5, h6, p, ul, ol, li");
but that does't work because in the resulting HTML code then those <li> elements are not wrapped in corresponding <ul> or <ol>.
I would be really grateful if you could get this problem resolved.
Thank you very much in advance for any reply.

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

1 participant