• In the following sentence, the quotes are not replaced with curly quotes:
    She asked a riddle ("What flickers like fire but is not fire?") and he replied correctly ("Blood!").
    I’m using WP 1.2 and the default Texturize engine (i.e., Textile is not enabled).

Viewing 9 replies - 1 through 9 (of 9 total)
  • just a question, did u copy the text from msword?

    Thread Starter marky

    (@marky)

    No, I didn’t. I just typed it. ??

    Becuase there is a non-space character on both sides of the quotes, it can’t know what to do them.

    Thread Starter marky

    (@marky)

    Both Textile and SmartyPants can handle this case, so there shouldn’t be any reason that Texturize can’t.

    WordPress 1.0.2 handled these cases fine; WordPress 1.2 doesn’t.
    After upgrading, I now need to go through all my posts (and through other people’s comments) to search for straight quotes and replace them with the curly quote HTML entities myself? Ugh.

    Thanks. Those changes didn’t seem to fix the problems with a quote marks preceding punctuation, though.
    In the meantime, I replaced the following lines in functions-formatting.php with their WordPress 1.0.2 equivalents:

    $curl = preg_replace('/(\s|\A)"(?!\s)/', '$1&# 8220;$2', $curl);
    $curl = preg_replace('/"(\s|\Z)/', '&# 8221;$1', $curl);

    to:

    $curl = preg_replace('/(\s|\A)"/', '$1&# 8220;', $curl);
    $curl = preg_replace('/"([\s.,!?;:&\']|\Z)/', '&# 8221;$1', $curl);

    (And remove the space between &# xxxx.)

    Argh, what I typed in got totally butchered.
    Sigh. Why don’t the WordPress forums have a preview? Grr.

    I’ve added the first hack above but am still getting problems for particular cases, for example here, where the quotes are around an anchor. Do any of the alternative text formatters handle quotations properly?

    I’ve made a diff file from the 2004-08-10 version of functions-formatting.php to fix some of the more annoying bugs I’ve encountered. One of them is a matter of taste (I think two hyphens should be turned into an em-dash and not an en-dash), but the other two are major annoyances for those who prefer to use single quotes and place punctuation outside of the quotation marks.
    https://zone38.net/blog/functions-formatting.diff
    For those who might be using a different version, the lines that were changed should be obvious, but the deletion may not be; it’s for the line that texturizes an apostrophe followed by a lowercase s.
    The combined fixes will prevent typographical travesties like this one:
    a€?This code’, thought the Anglophile programmer, a€?seems very broken indeed.a€? ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Texturize Quote-replacement Bug’ is closed to new replies.