Skip to content

robert-nix/ansihtml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansihtml

Travis codecov PkgGoDev

Go package to parse ANSI escape sequences to HTML.

Usage

html := ansihtml.ConvertToHTML([]byte("\x1b[33mThis text is yellow.\x1b[m"))
// html: `<span style="color:olive;">This text is yellow.</span>`

html := ansihtml.ConvertToHTMLWithClasses([]byte("\x1b[31mThis text is red."), "ansi-", false)
// html: `<span class="ansi-fg-red">This text is red.</span>`