#30322 closed defect (bug) (invalid)
word-wrap space and  %
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.0 |
Component: | Text Changes | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
WP 4.0 (TwentyFourteen theme) is randomly replacing space character with  % in the html output.
the DB post_content is
<h3>Refine AB Labels erbjuder lösningar med tåliga etiketter speciellt utvecklade för kemiskteknisk industri.</h3> <h4>Vilken väg ska vi ta?</h4> <p>Marknaden erbjuder olika alternativ för att hjälpa företag med klassificering. Här är några frågor ditt företag borde ställa innan ni genomför CLP förändringen.</p> <ul> <li>Har vi kompetensen att göra detta själva?</li> <li>Hur ofta måste vi klassificera d v s hur många olika kemiska ämnen och blandningar har vi?</li> <li>Finns det tekniska hjälpmedel som underlättar Klassificeringen?</li> </ul> <h4>CLP klassificering Bakgrund</h4> <p>Klassificering av ett ämne eller en blandning återspeglar farans allvarsgrad och typen av faror med ämnet eller blandningen, det vill säga dess potential att skada människor eller miljö. CLP-förordningen tillhandahåller kriterier för att bedöma huruvida klassificeringen av ett ämne eller en blandning är lämplig.</p> <h4>Vilka måste klassificera?</h4> <p>I allmänhet har tillverkare, importörer och nedströmsanvändare av ämnen och blandningar som ska föras in på marknaden skyldighet att kontrollera om de uppfyller klassificeringskriterierna, oavsett mängd.</p>
And the text renders incorrectly causing word-wrap to not work properly.
The browser output is:
<div class="entry-content"> <h3>Refine AB Labels erbjuder lösningar med tåliga etiketter speciellt utvecklade för kemiskteknisk industri.</h3> <h4>Vilken väg ska vi ta?</h4> <p>Marknaden erbjuder olika alternativ för att hjälpa företag med klassificering. Här är några frågor ditt företag borde ställa innan ni genomför CLP förändringen.</p> <ul> <li>Har vi kompetensen att göra detta själva?</li> <li>Hur ofta måste vi klassificera d v s hur många olika kemiska ämnen och blandningar har vi?</li> <li>Finns det tekniska hjälpmedel som underlättar Klassificeringen?</li> </ul> <h4>CLP klassificering Bakgrund</h4> <p>Klassificering av ett ämne eller en blandning återspeglar farans allvarsgrad och typen av faror med ämnet eller blandningen, det vill säga dess potential att skada människor eller miljö. CLP-förordningen tillhandahåller kriterier för att bedöma huruvida klassificeringen av ett ämne eller en blandning är lämplig.</p> <h4>Vilka måste klassificera?</h4> <p>I allmänhet har tillverkare, importörer och nedströmsanvändare av ämnen och blandningar som ska föras in på marknaden skyldighet att kontrollera om de uppfyller klassificeringskriterierna, oavsett mängd.</p> </div>
See example page here: http://refine.marketing/refine-labels.com/branscher/kemiskteknisk-industri/clp-klassificering-no-vc/
Is there a hot-fix or solution avaiable?
Attachments (1)
Change History (5)
#1
follow-up:
↓ 2
@
9 years ago
- Keywords reporter-feedback added
Do you have a plugin that could be inserting these? Can you test it with all plugins turned off or in an install that doesn't have any plugins? Are you pasting content into the editor?
#2
in reply to:
↑ 1
@
9 years ago
Replying to helen:
Do you have a plugin that could be inserting these? Can you test it with all plugins turned off or in an install that doesn't have any plugins? Are you pasting content into the editor?
No plugins which could interfer.
Background: Pasted text included utf8 space character \xc2\xa0 (invisible to the eye as it looks like an ordinary space \x20) but the css word-wrap wasn't working as it shouldn't.
Scenario 1: Yes, pasting the content into the "text editor" and I've found out the utf8 space character \xc2\xa0 is saved to DB "as-is" which cause issue for word-wrap.
Scenario 2: Yes, pasting the content into the "text editor" and I've found out the utf8 space character \xc2\xa0 is replaced with normal space \x20 which works as it should with word-wrap.
So it's technically not a real bug but an annoying issue with the editor not recognizing this and viewing it as in the editor when pasting or upon load from the DB.
In my opinion both text editors should behave the same and it needs to be a clear way for this to be managed.
Any suggestions for solutions to make sure that a non-programmer safely can save text w/o utf8 space character \xc2\xa0 ever being saved to DB ?
IMHO
#3
@
9 years ago
- Resolution set to worksforme
- Status changed from new to closed
There is a short-term fix I'e applied for now to solve my issue. Not the prettiest one but it works.
add_filter( 'wp_insert_post_data', 'rm_wp_insert_post_data', '99', 2 ); function rm_wp_insert_post_data ( $data , $postarr ) { return str_replace("\xc2\xa0", " ", $data); }
#4
@
9 years ago
- Milestone Awaiting Review deleted
- Resolution changed from worksforme to invalid
\xc2\xa0
is a non-breaking space, which is replaced by the html entity version
when pasted into TinyMCE for display on the front end.
If you're pasting into TinyMCE you might want to look into the Paste from Word option to clean such content from your sources up.
See also the previous tickets
4.0 word-wrap space issue