From 7ec42eb3e61f861ac2e831573bd347b73367b9f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 14 Jan 2014 17:05:29 +0100 Subject: [PATCH] Fix code copying for PHP in Google Chrome --- .../lib/system/bbcode/highlighter/PhpHighlighter.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wcfsetup/install/files/lib/system/bbcode/highlighter/PhpHighlighter.class.php b/wcfsetup/install/files/lib/system/bbcode/highlighter/PhpHighlighter.class.php index eadc35b382..df9730ae94 100644 --- a/wcfsetup/install/files/lib/system/bbcode/highlighter/PhpHighlighter.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/highlighter/PhpHighlighter.class.php @@ -56,8 +56,12 @@ class PhpHighlighter extends Highlighter { // remove breaks $highlightedCode = str_replace("\n", "", $highlightedCode); $highlightedCode = str_replace('
', "\n", $highlightedCode); + // get tabs back $highlightedCode = str_replace('    ', "\t", $highlightedCode); + // replace non breaking space with normal space, white-space is preserved by CSS + $highlightedCode = str_replace(' ', " ", $highlightedCode); + // convert colors to classes $highlightedCode = strtr($highlightedCode, self::$colorToClass); -- 2.20.1