Make WordPress Core

Opened 13 years ago

Closed 10 years ago

Last modified 10 years ago

#16957 closed defect (bug) (duplicate)

wptexturize - problem with numbers and non-breaking spaces

Reported by: pavelevap's profile pavelevap Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Formatting Keywords: needs-patch wptexturize needs-unit-tests
Focuses: Cc:


1) Insert following code into HTML editor and publish.

New <strong>Year "2011" will be</strong> fantastic.

Then look at website:

<p>New <strong>Year &#8221;2011&#8243; will be</strong> fantastic.</p>

You can see wrong html quotes.

2) I also worked with TinyMCE editor (only writing simple text, paragraphs, strong, moving some parts of text by CTRL+C and CTRL+V). But after publishing, there were hidden non-breaking spaces in text. There were on different places, for example before "(" and after characters ".", "í", "é", etc. But they were random. I am not sure how it can be caused? Non-breaking strings were not visible and also not transformed into &nbsp; HTML entity on website. I noticed them only in HEX editor, when examining HTML source code (C2 A0).

Of course, when these non-breaking spaces were before (or after) quotes, then quotes were not recognized regurarly by wpuntexturize, example:

Nemám žádné "úžasné" schopnosti.

Is transformed by wpuntexturize into:

<p>Nemám žádné &#8221;úžasné&#8221 schopnosti</p>.

You can see wrong open quote:

instead of &#8220 there is &#8221;

But only when hidden non-breaking space (C2 A0) is between žádné a "úžasné".

Attachments (1)

16957-quote-fix.diff (750 bytes) - added by aliso 12 years ago.
Corrects opening double quote after non-breaking space

Download all attachments as: .zip

Change History (13)

#1 @SergeyBiryukov
13 years ago

  • Keywords needs-patch added

#2 @aliso
12 years ago

Part 1 of this ticket is the same bug referenced in #8775. I just submitted a patch for it.

12 years ago

Corrects opening double quote after non-breaking space

#3 @SergeyBiryukov
12 years ago

Related to point 2: #23185

#4 @miqrogroove
11 years ago

wpuntexturize is not a core feature. Is this a bug report for a plugin??

#6 @pavelevap
11 years ago

No plugin, sorry, only spelling error...

#7 @miqrogroove
11 years ago

  • Summary changed from wpuntexturize - problem with numbers and non-breaking spaces to wptexturize - problem with numbers and non-breaking spaces

#8 @miqrogroove
11 years ago

I have a patch for your second issue at #22692.

If this ticket is duplicating other tickets now, I suggest we close it.

#9 @nacin
10 years ago

  • Keywords wptexturize added

#10 @nacin
10 years ago

  • Keywords needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release

This appears to be a duplicate of #8775 with the nbsp issue being handled by #22692 and possibly others. Let's construct a unit test? After, we can probably close this out.

#11 @miqrogroove
10 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Tests for #8775 are already in trunk. Tests for #22692 are attached on that ticket. Closing this one now.

#12 @DrewAPicture
10 years ago

  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.