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

[Bug] Ordered list restarts on every page when printed #174

Open
pabloscloud opened this issue Sep 23, 2022 · 2 comments
Open

[Bug] Ordered list restarts on every page when printed #174

pabloscloud opened this issue Sep 23, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@pabloscloud
Copy link

Describe the bug
When an ordered list continues on the next page it will start from the beginning (for example at 1)
This does not include the pdf / paper / print modes but rather the exported pdf

To Reproduce
Steps to reproduce the behavior:

  1. Go to a cryptee document
  2. Create a list from scratch, via the ordered list menu item or via keyboard shortcut
  3. Make sure the list is between separate pages by using the pdf / paper / print mode to view the cryptee document
  4. Export to pdf

Expected behavior
Should just continue counting

Screenshots
cryptee github.pdf

System Information (please complete the following information):

  • Device: MacBook Air M1, 2020
  • OS: macOS 13.0 Beta (22A5311f)
  • Browser: firefox
  • Browser Version: 13.0 Beta (22A5311f)
  • Browser Extensions / Add-ons / Content/Ad-Blockers uBlock Origin, Bitwarden, Multi-Account Containers, CSS-Exfill Protection, Decentralyses
  • Do you have any DNS-based content/ad-blockers? no
  • Are you on a managed network? no

Additional context
I also noticed that whenever I type on the second (or any other than the first) page it will jump to the first page and I can't see what I type.

@pabloscloud pabloscloud changed the title Ordered List Print refreshes on new page Ordered list restarts on every page when printed Sep 23, 2022
@pabloscloud pabloscloud changed the title Ordered list restarts on every page when printed [Bug] Ordered list restarts on every page when printed Nov 1, 2022
@johnozbay
Copy link
Member

Hey @pabloscloud 👋🏻

Thanks a lot for filing this!

We're aware of this bug, and we're working on a fix for it, but it's surprisingly difficult to fix.

In short, the bullet numbering system uses CSS counters. So if you're in continuous mode, and the list isn't interrupted, it works as expected.

But, in paper mode, you technically split the list into two pages (and two separate page-divs) which causes the list to be interrupted and the counter to be reset.

To work around this, when the list is split to two pages for example, we're working on prepending invisible list items to the list to keep the counter number the same.

It's surprisingly difficult and slow to work on paper mode, because the algorithm needs to calculate each character, their height and width and figure out if it belongs on this page or next page. So a list could theoretically be interrupted if each bullet has a paragraph that is so tall that it fills and exceeds the whole page. Then what would happen is that a single bullet item would take two pages, and some characters / words would be split to the next page. Which then means we need to implement the counter-trick differently.

Which is what's taking us some extra time. We hope to have a fix for this in the very near future though.

Thanks for your patience with us 🙏🏻

Best,

J

@johnozbay johnozbay added the bug Something isn't working label Feb 1, 2023
@johnozbay johnozbay self-assigned this Feb 1, 2023
@pabloscloud
Copy link
Author

To work around this, when the list is split to two pages for example, we're working on prepending invisible list items to the list to keep the counter number the same.

Clever!

Which then means we need to implement the counter-trick differently.

This issue isn't of high priority anyways imo. It's just a bit confusing — that's all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants