renderutil

package
v1.1.57 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LooksLikeMarkdown

func LooksLikeMarkdown(s string) bool

LooksLikeMarkdown reports whether s contains Markdown that benefits from a terminal renderer. Plain prose stays on the text wrapping path so long URLs and ordinary sentences are not reformatted unnecessarily.

func MarkdownStyleWrapWidth

func MarkdownStyleWrapWidth(contentWidth int) int

MarkdownStyleWrapWidth keeps Glamour from wrapping at tiny viewport widths while avoiding huge padded intermediate strings. Final viewport wrapping is still handled by WrapANSI.

func TrimANSIBlankLines

func TrimANSIBlankLines(s string) string

TrimANSIBlankLines removes leading and trailing lines that are visually blank after ANSI escape sequences are ignored.

func VisibleWidth

func VisibleWidth(s string) int

VisibleWidth returns the terminal cell width of s after normalizing tabs. ANSI escape sequences are zero-width.

func WrapANSI

func WrapANSI(text string, width int) string

WrapANSI wraps styled text to width cells using Charmbracelet's ANSI-aware wrapper. It preserves escape sequences and accounts for grapheme and CJK widths without maintaining a local ANSI parser.

func WrapPlainText

func WrapPlainText(text string, width int) string

WrapPlainText wraps raw model text to width cells without applying Markdown or path-specific token handling.

Types

This section is empty.

Jump to

Keyboard shortcuts

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