Make WordPress Core

Opened 7 years ago

Last modified 7 years ago

#43313 new defect (bug)

wptexturise uses the wrong curly quote after a closing link tag

Reported by: andfinally's profile andfinally Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Formatting Keywords:
Focuses: Cc:

Description

When an English possessive 's comes immediately after a closing link tag, wptexturise changes it to the wrong kind of curly quote mark.

To reproduce:

  • Enter some text with a link followed by an 's in your post content, for example
<a href="http://bbc.co.uk/news">BBC</a>'s approach
  • View the post in the front end.

What I expect

The filter replaces the straight single quote mark with a right curly apostrophe &#8217;

What I see instead

The filter replaces the quote mark with a left curly apostrophe &#8216;

Attachments (1)

apostropher.png (9.4 KB) - added by andfinally 7 years ago.
Wrong curly apostrophe on the front end

Download all attachments as: .zip

Change History (4)

@andfinally
7 years ago

Wrong curly apostrophe on the front end

#1 @SergeyBiryukov
7 years ago

  • Component changed from General to Formatting

#2 @andfinally
7 years ago

In case useful to anybody, I've added this filter to my theme as a temporary fix:

<?php
function fix_left_single_quotes( $content ) {
        $content= str_replace(['</a>&#8216;'], ['</a>&#8217;'], $content );

        return $content;
}

add_filter( 'the_content', 'fix_left_single_quotes', 11 );

#3 @soulseekah
7 years ago

This happens for all tags.

<strong>John</strong>'s

And shortcodes:

[name]'s address is:
Note: See TracTickets for help on using tickets.