Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#17207 closed defect (bug) (wontfix)

Don't replace quotes by literary quotes

Reported by: rom92's profile rom92 Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.1
Component: General Keywords:
Focuses: Cc:

Description

Every ' (0x27) are replaced by ’ (0xe28099, &#8217) in wp-includes/formatting.php.

This is very annoying.

When I copy-paste a part of text from my blog to somewhere, in the best case I have the text I write using ' and the text I copied using ’ (which is inconsistent), but in the worst case, the site/tool where I paste the text doesn't manage correctly special characters, while it's just a quote (it should not be a special character) : I have to manually replace them every time I paste.

The content of the comments is inconsistent too : I write something in an article or in a comment : "I'm ok". In database, it is written "I'm ok". When displaying, it is written "I’m ok".
Someone quote (using copy-paste) what I wrote for commenting it, and it's written "I’m ok" in database (it's inconsistent).

Change History (4)

#1 @duck_
12 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

This is intended behaviour for display of content. You can stop this by removing wptexturize from the hooks it's attached to. See wp-includes/default-filters.php for the places it is used. Then you can pretty much do the same but replace add_filter with remove_filter and put it in a plugin or in your theme's functions.php.

I cannot say if this is the original reason for being on a filter, but to have the original unchanged content in the database makes sense and only change it for display like this.

#2 @duck_
12 years ago

  • Milestone Awaiting Review deleted

#3 @rom92
12 years ago

I want to keep wptexturize, but not for single quotes… I think I will change formatting.php (except if you have a better idea).

#4 @scribu
12 years ago

You can remove wptexturize from the list of hooks it's added to by default and then roll your own.

See wp-includes/default-filters.php and the remove_filter() function.

If you're running into problems, feel free to ask for help in the support forums: http://wordpress.org/support

Note: See TracTickets for help on using tickets.