Ansi sequences #3450
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
We don't have any components highlighting Ansi sequences, no. Seems like you'll have to add that yourself. That being said, if your text is literally this (no escaped Ansi sequences):
then Prism won't be able to highlight anything. We can highlight text based on the characters that are actually present. |
Beta Was this translation helpful? Give feedback.
-
@silverqx Do you want to render ANSI escapes in the browser? I don't think that Prism is the right package to do that. If you want to render HTML from ANSI art I have a package like this ansidec. But this package is old and it doesn't handle all ANSI escape codes. The code was extracted from jQuery Terminal. But I've replaced my regex-based parser with a real ANSI Parser. If you want to create your own highlighter it's better to just use that parser. unix_formatting.js file contains my processor, it translates ANSI Code into the intermediate language used by jQuery Terminal (it's called terminal formatting). If you don't want to write any extra code, you can copy/paste $.terminal.format function inside jQuery Terminal that converts terminal formatting into HTML and use unix_formatting file as is. It includes ANSI Parser. |
Beta Was this translation helpful? Give feedback.
We don't have any components highlighting Ansi sequences, no. Seems like you'll have to add that yourself.
That being said, if your text is literally this (no escaped Ansi sequences):