From: Tim Düsterhus Date: Tue, 14 Jan 2014 16:05:29 +0000 (+0100) Subject: Fix code copying for PHP in Google Chrome X-Git-Tag: 2.0.2~21^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7ec42eb3e61f861ac2e831573bd347b73367b9f1;p=GitHub%2FWoltLab%2FWCF.git Fix code copying for PHP in Google Chrome --- 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);