ansihtml

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ansihtml converts text containing ANSI SGR escape sequences into HTML where styling is applied via <span class="ansi-..."> wrappers.

Only a minimal set of SGR parameters is recognized (reset, bold, dim, 22 normal intensity, 30-37/39 foreground colors). Other CSI sequences are stripped. All non-escape content is HTML-escaped.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(s string) string

Convert returns s rewritten so that recognized ANSI SGR sequences become nested <span class="..."> wrappers. Unrecognized CSI sequences are dropped and all literal text is HTML-escaped. The returned string is safe to inline inside a <pre> element.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL