Aleksandar • Vacić

iOS bits and pieces

Backslashes gone

The WP bug that waxed me so much in the past months is finally gone. At least here. Wherever I had " (double-quote) inside of pre tag, it would be outputted as \" - always prefixed with backslash.

Tonight I dug in into WP core and found that the problematic part is line 76 in file wp-includes/functions-formating.php. When you remove that line, all is displaying nice.

$pee = preg_replace('!(</pre><pre .*?>)(.*?)</pre>!ise',

" stripslashes('$1') .  clean_pre('$2')  . '' ", $pee);

Since wpautop function is not really required in my case (I write entire HTML for my posts), I instead opted to comment out this filter - it’s line 64 in wp-includes/default-filters.php:

// add_filter('the_content', 'wpautop');