typography -> format_characters() incorrectly converting quotes in tags #1212

barnabywalters opened this Issue Mar 22, 2012 · 3 comments

4 participants


Despite the docs saying:

Quotes are converted to correctly facing curly quote entities, except those that appear within tags

format_characters() doesn't work in the same way. For example, this has been passed through auto_typography():

<figure class="floatRight">

But the same source passed through format_characters() produces this:

<figure class=&#8220;floatRight&#8221;>
@ckdarby ckdarby added a commit that referenced this issue Jun 6, 2012
@ckdarby ckdarby Issue #1212 03b5436

@narfbg You mentioned this being a bug in the pull request so it should be noted that the documentation of the function should be updated as well as I was basing my update to the docs on the fact the function PHP comment didn't state this functionality.

 * Format Characters
 * This function mainly converts double and single quotes
 * to curly entities, but it also converts em-dashes,
 * double spaces, and ampersands
 * @param   string
 * @return  string
public function format_characters($str)

It might not be mentioned in the PHP docblock, but it is the intended behavior - this is not an escaping function.


Alright I'll make a pull request with a fix later this week if no one else grabs it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment