TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Fancy-ANSI – Small JavaScript library for converting ANSI to HTML

16 pointsby andresabout 1 year ago
I made this tool to add support for custom ANSI palettes to kubetail (<a href="https:&#x2F;&#x2F;github.com&#x2F;kubetail-org&#x2F;kubetail">https:&#x2F;&#x2F;github.com&#x2F;kubetail-org&#x2F;kubetail</a>). Maybe you&#x27;ll find it useful too.<p>Let me know if you have any suggestions!

4 comments

giraffe_ladyabout 1 year ago
Ah this is awesome. I&#x27;ve been working on a browser based mud client and none of the existing options handled everything I needed. I&#x27;ll be switching to this immediately, it seems to solve all of my current problems with displaying ansi text in the browser.
评论 #39945728 未加载
epageabout 1 year ago
Recently did something similar in Rust but for generating SVGs. We&#x27;ve adopted it for snapshot testing of cargo and rustc&#x27;s output. Don&#x27;t have a good PR handy for showing Github&#x27;s rendering of changes in the SVG (text, side-by-side, swiping) but <a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;pull&#x2F;121877&#x2F;files">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;pull&#x2F;121877&#x2F;files</a> has newly added SVGs.<p>To see what is supported, see the screenshot in the docs: <a href="https:&#x2F;&#x2F;docs.rs&#x2F;anstyle-svg&#x2F;latest&#x2F;anstyle_svg&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.rs&#x2F;anstyle-svg&#x2F;latest&#x2F;anstyle_svg&#x2F;</a>
blueflowabout 1 year ago
It is unclear to what extent the ANSI control codes are implemented. The README mentions SGR and the 24-bit color extensions in the nonstandard semicolon syntax. What about cursor movements? Backspace? Overstriking?<p>Which &quot;ANSI&quot; did you use as reference?
评论 #39945643 未加载
评论 #39945562 未加载
chrismorganabout 1 year ago
Simple bug report: an empty SGR (CSI m, ) doesn’t do anything, but should be equivalent to 0, reset all.
评论 #39945656 未加载