PandocAnsiFilter/ansi2html.lua
2022-09-21 13:26:09 +02:00

38 lines
581 B
Lua

local codes = {
-- attributes
reset = 0,
bright = 1,
dim = 2,
underscore = 4,
-- blink = 5,
reverse = 7,
-- hidden = 8,
-- foreground
black = 30,
red = 31,
green = 32,
yellow = 33,
blue = 34,
magenta = 35,
cyan = 36,
white = 37,
-- background
onblack = 40,
onred = 41,
ongreen = 42,
onyellow = 43,
onblue = 44,
onmagenta = 45,
oncyan = 46,
onwhite = 47,
}
function CodeBlock(e)
if string.find(e.text, "\u{001b}\u{005b}", 1, true) then
print(e.text)
end
end