Ticket #12335: 12335-video.diff
File 12335-video.diff, 1.5 KB (added by , 14 years ago) |
---|
-
formatting.php
185 185 $pee = $pee . "\n"; // just to make things a little easier, pad the end 186 186 $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee); 187 187 // Space things out a little 188 $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend )';188 $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|details)'; 189 189 $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); 190 190 $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee); 191 191 $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines … … 193 193 $pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed 194 194 $pee = preg_replace('|\s*</embed>\s*|', '</embed>', $pee); 195 195 } 196 if ( strpos($pee, '<video') !== false || strpos($pee, '<audio') !== false ) { 197 $pee = preg_replace('|\s*<source([^>]*)>\s*|', "<source$1>", $pee); // no pee inside video/audio 198 } 196 199 $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates 197 200 // make paragraphs, including one at the end 198 201 $pees = preg_split('/\n\s*\n/', $pee, -1, PREG_SPLIT_NO_EMPTY);