[PATCH] Bug in wptexturize applying "smart quotes" when tags are nested
  • I ran across a bug where some code sections of mine was being incorrectly modified by the wptexturize function of Flatpress, which converts apostrophes to "smart quotes":


    <code>these 'quotes' are correctly ignored<a>link</a> these 'quotes' are incorrectly converted</code>


    The bug happens because wptexturize used a simple boolean flag to control whether to ignore blocks or not. The internal "a" tag would reset the flag. Here's a patch that fixes the issue (applies cleanly to current SVN, rev 403), replacing the boolean flag with a counter, so that opening tags increment the counter and closing tags decrement it.

    http://hisham.hm/files/flatpress-403-wptexturize-nested-tags.diff
  • committed to svn.

In this Discussion