[wp-trac] [WordPress Trac] #48602: wptexturize: smart quotes: should ignore tags inside quotes
WordPress Trac
noreply at wordpress.org
Mon Dec 9 05:30:40 UTC 2019
#48602: wptexturize: smart quotes: should ignore tags inside quotes
----------------------------------------+-----------------------------
Reporter: kurakin_alexander | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Formatting | Version: 5.2.2
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+-----------------------------
Changes (by jeremyfelt):
* keywords: => has-patch needs-unit-tests
* milestone: Awaiting Review => Future Release
Comment:
Thanks for opening this ticket, @kurakin_alexander, I've run into this
myself recently.
A few variations:
{{{
# This should be 8220 and 8221
wp> wptexturize( '"<em>these quotes are wrong!</em>"' );
string(46) "“<em>these quotes are wrong!</em>“"
# This should be 8220 and 8221. The em dash causes a flip of sorts.
wp> wptexturize( 'Interrupt this with a quote—"<em>these quotes are
wrong!</em>"' );
string(76) "Interrupt this with a quote—”<em>these quotes are
wrong!</em>“"
# And as a bonus, this should be 8220 and 8221, but has no tags, just a
preceding em dash.
wp> wptexturize( 'Interrupt this with a quote—"these quotes are wrong!"'
);
string(67) "Interrupt this with a quote—”these quotes are
wrong!”"
}}}
A first patch could probably add those to the tests.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48602#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list