-
Notifications
You must be signed in to change notification settings - Fork 4
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
Prevent widows in titles with javascript #41
Comments
Ah, this one comes from further down in the comments. It works without problems.
|
We could do this for paragraphs too, if we wanted to be perfectionists. I don't think the performance impact would be noticeable next to MathJax. We'd have to test it on a long document (many paragraphs) with MathJax disabled to be sure. |
Nice idea for titles. But it strikes me as overkill for paragraphs. What if a title has math in it like "A theorem about |
That's a good point. I bet it would screw that up. With some careful thought, I bet the function could be adapted to avoid that situation. I get the suspicion David is good with regular expressions. Maybe he could give it a shot? |
He's the best. |
The idea of "put a non-breaking space when the last word is short"
Some people even put hard returns (LaTeX ) in their titles. If you knew that math was the only exception to handle (so the above On Sun, 17 Aug 2014, Michael DuBois wrote:
|
by adapting this function:
http://css-tricks.com/snippets/jquery/add-non-breaking-space-on-title-to-prevent-widows/
As is, it removes the links in the ToC
h2
s, but I bet it can be improved.The text was updated successfully, but these errors were encountered: