Opened 10 years ago
Closed 8 years ago
#28449 closed enhancement (wontfix)
Prevent widows
Reported by: | benoitchantre | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.9.1 |
Component: | Formatting | Keywords: | |
Focuses: | Cc: |
Description
A good practice of typography is to avoid widows and orphans in a text.
On small screens, this becomes more important because we have more widows.
Would it be possible to automatically insert a non-breaking space before the last word of any text (title, paragraph, list item, etc.).
Attachments (2)
Change History (13)
#4
follow-up:
↓ 6
@
10 years ago
This should probably be added as a filter rather than hardcoded into the_content()
.
#5
@
10 years ago
This is a problem that should be solved. I've implemented JS libraries like balance text to avoid orphans.
Having said that, I think it's intrusive for a CMS to try to fix this problem. Browsers should figure out a native solution, and I've tried to push a proposal in the CSSWG to accomplish this.
#6
in reply to:
↑ 4
@
10 years ago
Replying to SergeyBiryukov:
This should probably be added as a filter rather than hardcoded into
the_content()
.
Hi,
I adjusted my patch, as per your suggestion, making it a filter. I also enhanced it further to avoid relying on regex and incorporated a couple of parameters to manipulate the number of words which should wrap and the characters that should be filtered for.
#8
follow-up:
↓ 9
@
8 years ago
- Keywords close added; has-patch reporter-feedback removed
I'm going to suggest we close this as wontfix, and follow-up with the CSS Working Group about pushing this forward in the spec.
#9
in reply to:
↑ 8
;
follow-up:
↓ 10
@
8 years ago
Replying to ericlewis:
I'm going to suggest we close this as wontfix, and follow-up with the CSS Working Group about pushing this forward in the spec.
Appears to already be in the works.. CSS Fragmentation Module Level 3 https://drafts.csswg.org/css-break/#breaking-controls
#10
in reply to:
↑ 9
@
8 years ago
Replying to dcondrey:
Replying to ericlewis:
I'm going to suggest we close this as wontfix, and follow-up with the CSS Working Group about pushing this forward in the spec.
Appears to already be in the works.. CSS Fragmentation Module Level 3 https://drafts.csswg.org/css-break/#breaking-controls
I haven't tested it, but it should work in many browsers : http://caniuse.com/#search=widows.
I think we can close this issue ; it's better to use CSS to solve that.
--
Update
Tested with Chrome : it only works for print media, not screen
#11
@
8 years ago
- Keywords close removed
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
text-wrap: balanced will be in CSS4 as well. Closing this out, apologies for the wait @benoitchantre :)
patch