Support » Requests and Feedback » Backslashes in 1.2 get eaten

Backslashes in 1.2 get eaten

  • FYI,
    WP1.2 eats backslashes. If you must use backslashes (e.g., for win32 filenames), you must enter two backslashes (not a real problem). However, the preview is incorrect, in that two backslashes result in two backslashes being displayed (not one). What’s worse is that, every time you preview or edit a post, one backslash gets silently “eaten” from the source, until none are left.

Viewing 10 replies - 1 through 10 (of 10 total)
  • This behavior also makes it diffucult to escape the Smartypants plugin, which uses a backslash as its escape character.

    I think this is because WP is very big on XHTML validity. I don’t know why they aren’t escaped, though. I’ve also had problems with the elipsis character (…) being created by WP, then breaking the XML validity of my RSS feed, as they are not valid XHTML unless they are escaped with the proper ASCII code. Any idea when this will be fixed? Or is this not really a problem, and I’m missing something? Thanks!

    I’ve noticed it does essentially the same thing with double-dashes. If I specify, in a <code /> block, a command-line with double-dashes (ie. “–prefix=/usr/local” becomes “-prefix=/usr/local”).
    It doesn’t “eat” the missing dash, it just collapses doubles into singles.
    I’m assuming that somewhere there is a regexp causing it.

    Heh, oops. In the post directly above, right before the word “block”, I had the word “code” enclosed between a less-than and a greater-than.
    Tho, interestingly enough, in my example the double-dash was not collapsed.

    Sorry, it probably seems like I’m spamming this topic. The issue I had with dashes is actually by design. The function wptexturize in “wp-includes/functions-formatting.php” converts pairs of dashes to an “en dash.”
    Nevermind 😉

    (From Meitar, not the above anonymous user)
    Nevertheless, single backslashes in posts *do* get eaten, and this is somewhat troublesome since I need to be able to type them, obviously.
    Is there any definitive answer on whether this is or is not a bug (and if so, when it might be fixed)? I haven’t had the time to dig through the source of WordPress myself yet, and I’m sure others are more familiar with it than I.

    Shouldn’t double-dashes be replaced into an M-DASH, not an N-dash, from a typographical point of view?

    Moderator Ryan Boren


    WordPress Dev

    This bug is already fixed in CVS. 1.3 will not have this problem.

    Can the fix be back-ported to 1.2 easily? Any hints on where to look for it?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Backslashes in 1.2 get eaten’ is closed to new replies.