-
Notifications
You must be signed in to change notification settings - Fork 500
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
Truncate toc entry if its length exceeds a single line #200
Comments
Zonk! I never thought of that case. This will definitely make a great test case. I did some research on this and determined that a quick fix (a) is to just set the number of dots to 0 if the calculated result is less than zero. However, the title text will still wrap. So the next fix (b) is to only allow the title to consume a single line. However, then the text could still overlap the page number. The final fix (c) is to prevent the title text from expanding past a fixed column (better that it is fixed I think for consistency). Perhaps something like 80 or 90% of the page. That should leave enough room for the page numbers. In this case, the dots get a bit off, but I don't think that's a huge concern atm. |
I think I'll move forward with (a) and (b) right away so that the processor isn't crashing. Then, I'll try to arrive at a nice solution for (c). |
I've done (a) in master just so that you can move forward. |
personally I just used a max between computed number and 0. If it is not enough wrapping or whatever solution makes rendering less nice IMO and needs "writer" works. That said if you manage to get a nicer default it is really better. |
👍 Btw, thanks for pointing this out! |
@mojavelinux Per the release notes for Alpha 8, it says this issue is closed ... but it looks like it is still open? |
This is only partially addressed. A quick fix is in place, but there's still work to do to make it cover all cases in the proper way. |
The milestone should be set to 1.5.0.beta.1 for now. |
Depending the text
can be negative.
In this case the next line (1571 in converter.rb):
will fail with
Would be great to
The text was updated successfully, but these errors were encountered: