WordPress.org

Make WordPress Core

Opened 21 months ago

Last modified 19 months ago

#43313 new defect (bug)

wptexturise uses the wrong curly quote after a closing link tag

Reported by: andfinally Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Formatting Keywords:
Focuses: Cc:
PR Number:

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 21 months ago.
Wrong curly apostrophe on the front end

Download all attachments as: .zip

Change History (4)

@andfinally
21 months ago

Wrong curly apostrophe on the front end

#1 @SergeyBiryukov
21 months ago

  • Component changed from General to Formatting

#2 @andfinally
21 months 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
19 months ago

This happens for all tags.

<strong>John</strong>'s

And shortcodes:

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