# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/lib/htmlpurifier/HTMLPurifier/Lexer.php
--- moodle/lib/htmlpurifier/HTMLPurifier/Lexer.php Base (1.8)
+++ moodle/lib/htmlpurifier/HTMLPurifier/Lexer.php Locally Modified (Based On 1.8)
@@ -252,8 +252,10 @@
     public function normalize($html, $config, $context) {
 
         // normalize newlines to \n
+        if ($config->get('Output.Newline')!=="\n") {
         $html = str_replace("\r\n", "\n", $html);
         $html = str_replace("\r", "\n", $html);
+        }
 
         if ($config->get('HTML.Trusted')) {
             // escape convoluted CDATA
Index: moodle/lib/htmlpurifier/readme_moodle.txt
--- moodle/lib/htmlpurifier/readme_moodle.txt Base (1.13)
+++ moodle/lib/htmlpurifier/readme_moodle.txt Locally Modified (Based On 1.13)
@@ -4,5 +4,6 @@
  * HMLTModule/Text.php - added  <nolink>, <tex>, <lang> and <algebra> tags
  * HMLTModule/XMLCommonAttributes.php - remove xml:lang - needed for multilang
  * AttrDef/Lang.php - relax lang check - needed for multilang
+ * Lexer.php - Subverted line break normalisation (requires setting: Output.Newline to \n)
 
 skodak
Index: moodle/lib/weblib.php
--- moodle/lib/weblib.php Base (1.1427)
+++ moodle/lib/weblib.php Locally Modified (Based On 1.1427)
@@ -1496,6 +1496,7 @@
     if ($purifier === false) {
         require_once $CFG->libdir.'/htmlpurifier/HTMLPurifier.safe-includes.php';
         $config = HTMLPurifier_Config::createDefault();
+        $config->set('Output.Newline', "\n");
         $config->set('Core.ConvertDocumentToFragment', true);
         $config->set('Core.Encoding', 'UTF-8');
         $config->set('HTML.Doctype', 'XHTML 1.0 Transitional');
