Ticket #30162: formatting.php.patch
File formatting.php.patch, 1.0 KB (added by , 10 years ago) |
---|
-
formatting.php
1865 1865 $nested_code_pre = 0; // Keep track of how many levels link is nested inside <pre> or <code> 1866 1866 foreach ( $textarr as $piece ) { 1867 1867 1868 if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) )1868 if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) || preg_match( '|^<script[\s>]|i', $piece ) || preg_match( '|^<style[\s>]|i', $piece ) ) 1869 1869 $nested_code_pre++; 1870 elseif ( ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) ) && $nested_code_pre)1870 elseif ( $nested_code_pre && ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) || '</script>' === strtolower( $piece ) || '</style>' === strtolower( $piece ) ) ) 1871 1871 $nested_code_pre--; 1872 1872 1873 1873 if ( $nested_code_pre || empty( $piece ) || ( $piece[0] === '<' && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) {