diff --git a/src/Composer/Console/HtmlOutputFormatter.php b/src/Composer/Console/HtmlOutputFormatter.php
index 8a79dba08..cd8c7fd4e 100644
--- a/src/Composer/Console/HtmlOutputFormatter.php
+++ b/src/Composer/Console/HtmlOutputFormatter.php
@@ -59,7 +59,7 @@ class HtmlOutputFormatter extends OutputFormatter
{
$formatted = parent::format($message);
- return preg_replace_callback("{\033\[([0-9;]+)m(.*?)\033\[0m}s", array($this, 'formatHtml'), $formatted);
+ return preg_replace_callback("{\033\[([0-9;]+)m(.*?)\033\[(?:39|49|0|22|24|25|27|28)m}s", array($this, 'formatHtml'), $formatted);
}
private function formatHtml($matches)
diff --git a/tests/Composer/Test/Console/HtmlOutputFormatterTest.php b/tests/Composer/Test/Console/HtmlOutputFormatterTest.php
new file mode 100644
index 000000000..758087b9a
--- /dev/null
+++ b/tests/Composer/Test/Console/HtmlOutputFormatterTest.php
@@ -0,0 +1,28 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer;
+
+use Composer\Console\HtmlOutputFormatter;
+
+class HtmlOutputFormatterTest extends \PHPUnit_Framework_TestCase
+{
+ public function testFormatting()
+ {
+ $formatter = new HtmlOutputFormatter;
+
+ return $this->assertEquals(
+ 'Reading composer.json of https://github.com/ccqgithub/sherry-php (master)',
+ $formatter->format('Reading composer.json of https://github.com/ccqgithub/sherry-php (master)')
+ );
+ }
+}