|
13 | 13 | class PostprocessingHandler
|
14 | 14 | {
|
15 | 15 | /**
|
16 |
| - \brief Converts text with ANSI color codes to HTML. |
17 |
| -
|
18 |
| - \param string $text The string to convert. |
19 |
| - \return A string with HTML tags. |
20 |
| -
|
21 |
| - Takes a string with ANSI color codes and converts them to HTML tags. Can be |
22 |
| - useful for displaying the output of terminal commands on a web page. Handles |
23 |
| - codes that modify the color (foreground and background) as well as the format |
24 |
| - (bold, italics, underline and strikethrough). Other codes are ignored. |
25 |
| -
|
26 |
| - An ANSI escape sequence begins with the characters <b>^[</b> (hex 0x1B) and |
27 |
| - <b>[</b>, and ends with <b>m</b>. The color code is placed in between. Multiple |
28 |
| - color codes can be included, separated by semicolon. |
| 16 | + * \brief Converts text with ANSI color codes to HTML. |
| 17 | + * |
| 18 | + * \param string $text The string to convert. |
| 19 | + * \return A string with HTML tags. |
| 20 | + * |
| 21 | + * Takes a string with ANSI color codes and converts them to HTML tags. Can be |
| 22 | + * useful for displaying the output of terminal commands on a web page. Handles |
| 23 | + * codes that modify the color (foreground and background) as well as the format |
| 24 | + * (bold, italics, underline and strikethrough). Other codes are ignored. |
| 25 | + * |
| 26 | + * An ANSI escape sequence begins with the characters <b>^[</b> (hex 0x1B) and |
| 27 | + * <b>[</b>, and ends with <b>m</b>. The color code is placed in between. Multiple |
| 28 | + * color codes can be included, separated by semicolon. |
29 | 29 | */
|
30 | 30 | function ansi_to_html($text)
|
31 | 31 | {
|
|
0 commit comments