Is there some way to just get raw UTF-8 text out of lowdown(1) without ANSI characters? My output device is a web browser, so ANSI control characters don't work. The other option would be if there's a library that converts ANSI to HTML in some reasonable C library that I can embed into my CGI app.

@irl you can use -Thtml flag to output HTML directly IIRC

@zpojqwfejwfhiunz that would be too easy. I want to generate a text file, and then stick that in a <pre> tag in a web page.

@irl ok, other things that come to mind:

  1. does lowdown respect the terminal settings? if so, you can set TERM=xterm-old and it won't even try adding ANSI
  2. A classic: pipe through something that can filter them out like sed 's/\x1b\[[0-9;]*m//g'

@zpojqwfejwfhiunz it's not really lowdown that's generating the output the way i'm doing it right now. I get lowdown to generate groff (with ms macros) and then get groff to output the text file.

the way that it's generating right now means that it's got a character, then it does a backspace, then the character again, which on my teleprinter would be "bold" but my web browser doesn't work that way.

@sh I think that's probably what I want, except I might pull that function out and add it to my gopherproxy. I've actually been hacking on your code I think.

irl.xyz/

Follow

@sh Also I think I've made a complete mess of it and I should stop.

@irl Fixin a mess is a learning opportunity. Happy Hacking :flan_cleaver:
Sign in to participate in the conversation
hackers.town

A bunch of technomancers in the fediverse. Keep it fairly clean please. This arcology is for all who wash up upon it's digital shore.