Copy & paste the following in the html post editor:


Then click preview button and see the results. It will be:


This is grammatically incorrect. It should be:


It should always be a closed apostrophe. Any solutions to this? Obviously, the <em> tag conflicts the quote transformation.

I'm guessing wptexturize() does the quote transformations? Shouldn't it strip the tags first before interpreting the text...?

  • 1
    I just actually took a look at this, strangely wptexturize() should do its job like you expect it. Because this is the match and this the replacement - if I understand the code correctly. Example at regex101 tester. Sorry, still no real help, just confusion. – Nicolai Jul 21 '15 at 21:43
  • @ialocin Thank you for the research, one step closer to potential solution. – Christine Cooper Jul 21 '15 at 22:35
  • 2
    Bingo @Christine Cooper, another years-long outstanding bug uncovered - core.trac.wordpress.org/ticket/18549 - you're good at this! The offending line is 129 in formatting @ialocin I think (although you could argue wptexturize() is one long offending line...) - if the regex's changed to eg '/(?<=\A|[([{"\-]|&lt;|' . $spaces . ')\'(?!s\b)/' (to not match 's on its own) then this problem at least goes away... – bonger Jul 21 '15 at 23:47
  • 1
    @bonger Not again!... :D Thank you very much for posting this and bringing some clarity into the problem. I guess all we can do is to hope that they will care enough to implement a fix for this in core level sometime within the next decade or two. – Christine Cooper Jul 22 '15 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.