Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / caxy / php-htmldiff / lib / Caxy / HtmlDiff / HtmlDiffConfig.php
index 0d0cbd1b98c2b912a3dc95815420855f76860b62..2bfdcaa0b6b4bcd264461a6ab9731a41ab3ea99a 100644 (file)
@@ -27,6 +27,12 @@ class HtmlDiffConfig
      */
     protected $insertSpaceInReplace = false;
 
+    /**
+     * Whether to keep newlines in the diff
+     * @var bool
+     */
+    protected $keepNewLines = false;
+
     /**
      * @var string
      */
@@ -48,6 +54,7 @@ class HtmlDiffConfig
         'i' => '[[REPLACE_EM]]',
         'a' => '[[REPLACE_A]]',
         'img' => '[[REPLACE_IMG]]',
+        'pre' => '[[REPLACE_PRE]]',
     );
 
     /**
@@ -293,6 +300,22 @@ class HtmlDiffConfig
         return $this;
     }
 
+    /**
+     * @return bool
+     */
+    public function isKeepNewLines()
+    {
+        return $this->keepNewLines;
+    }
+
+    /**
+     * @param bool $keepNewLines
+     */
+    public function setKeepNewLines($keepNewLines)
+    {
+        $this->keepNewLines = $keepNewLines;
+    }
+
     /**
      * @return array
      */
@@ -322,7 +345,7 @@ class HtmlDiffConfig
     public function addIsolatedDiffTag($tag, $placeholder = null)
     {
         if (null === $placeholder) {
-            $placeholder = sprintf('[[REPLACE_%s]]', strtoupper($tag));
+            $placeholder = sprintf('[[REPLACE_%s]]', mb_strtoupper($tag));
         }
 
         if ($this->isIsolatedDiffTag($tag) && $this->isolatedDiffTags[$tag] !== $placeholder) {