ansi HTML adapter, in JS