Commit 821f6190 authored by Steven Wittens's avatar Steven Wittens
Browse files

- Line-break filter now also ignores <style> (already ignored <pre> and <script>).

parent 4d950355
......@@ -942,11 +942,11 @@ function _filter_html($text, $format) {
* Based on: http://photomatt.net/scripts/autop
*/
function _filter_autop($text) {
// Split at <pre>, <script> and </pre>, </script> tags.
// Split at <pre>, <script>, <style> and </pre>, </script>, </style> tags.
// We don't apply any processing to the contents of these tags to avoid messing
// up code. We look for matched pairs and allow basic nesting. For example:
// "processed <pre> ignored <script> ignored </script> ignored </pre> processed"
$chunks = preg_split('@(</?(?:pre|script)[^>]*>)@', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$chunks = preg_split('@(</?(?:pre|script|style)[^>]*>)@', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
// Note: PHP ensures the array consists of alternating delimiters and literals
// and begins and ends with a literal (inserting NULL as required).
$ignore = false;
......
......@@ -942,11 +942,11 @@ function _filter_html($text, $format) {
* Based on: http://photomatt.net/scripts/autop
*/
function _filter_autop($text) {
// Split at <pre>, <script> and </pre>, </script> tags.
// Split at <pre>, <script>, <style> and </pre>, </script>, </style> tags.
// We don't apply any processing to the contents of these tags to avoid messing
// up code. We look for matched pairs and allow basic nesting. For example:
// "processed <pre> ignored <script> ignored </script> ignored </pre> processed"
$chunks = preg_split('@(</?(?:pre|script)[^>]*>)@', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$chunks = preg_split('@(</?(?:pre|script|style)[^>]*>)@', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
// Note: PHP ensures the array consists of alternating delimiters and literals
// and begins and ends with a literal (inserting NULL as required).
$ignore = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment