Opened 2 years ago

Last modified 4 months ago

#16957 new defect (bug)

wpuntexturize - problem with numbers and non-breaking spaces

Reported by: pavelevap Owned by:
Priority: normal Milestone: Awaiting Review
Component: Formatting Version: 3.1
Severity: normal Keywords: needs-patch
Cc: pavelevap@…

Description

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 10 months ago.
Corrects opening double quote after non-breaking space

Download all attachments as: .zip

Change History (4)

  • Keywords needs-patch added

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

aliso10 months ago

Corrects opening double quote after non-breaking space

Related to point 2: #23185

Note: See TracTickets for help on using tickets.