@@ -95,8 +95,9 @@ protected function convertAnsiToColor($ansi)
9595 {
9696 $ bg = 0 ;
9797 $ fg = 7 ;
98- $ as = '' ;
99- $ hi = false ;
98+ $ as = '' ; // inline styles
99+ $ cs = '' ; // css classes
100+ $ hi = false ; // high intensity
100101 if ('0 ' != $ ansi && '' != $ ansi ) {
101102 $ options = explode ('; ' , $ ansi );
102103
@@ -129,14 +130,17 @@ protected function convertAnsiToColor($ansi)
129130
130131 if (in_array (3 , $ options )) {
131132 $ as .= '; font-style: italic ' ;
133+ $ cs .= ' ansi_color_italic ' ;
132134 }
133135
134136 if (in_array (4 , $ options )) {
135137 $ as .= '; text-decoration: underline ' ;
138+ $ cs .= ' ansi_color_underline ' ;
136139 }
137140
138141 if (in_array (9 , $ options )) {
139142 $ as .= '; text-decoration: line-through ' ;
143+ $ cs .= ' ansi_color_strikethrough ' ;
140144 }
141145
142146 if (in_array (7 , $ options )) {
@@ -149,7 +153,7 @@ protected function convertAnsiToColor($ansi)
149153 if ($ this ->inlineStyles ) {
150154 return sprintf ('</span><span style="background-color: %s; color: %s%s"> ' , $ this ->inlineColors [$ this ->colorNames [$ bg ]], $ this ->inlineColors [$ this ->colorNames [$ fg ]], $ as );
151155 } else {
152- return sprintf ('</span><span class="ansi_color_bg_%s ansi_color_fg_%s"> ' , $ this ->colorNames [$ bg ], $ this ->colorNames [$ fg ]);
156+ return sprintf ('</span><span class="ansi_color_bg_%s ansi_color_fg_%s%s "> ' , $ this ->colorNames [$ bg ], $ this ->colorNames [$ fg ], $ cs );
153157 }
154158 }
155159
0 commit comments