X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Freport.git;a=blobdiff_plain;f=pret-haskell.lua;h=ca3a1651d520ae2c13f99426f45af90f2498c4cc;hp=4ce8d3e524670d51077b56b4f3967553cb93e6c0;hb=313351372e8c609c2875902d9c9a2b89f7c97032;hpb=0d8416497fa7977a160dff8f63214ec6ebac1ac8 diff --git a/pret-haskell.lua b/pret-haskell.lua index 4ce8d3e..ca3a165 100644 --- a/pret-haskell.lua +++ b/pret-haskell.lua @@ -40,6 +40,13 @@ function visualizer.flush_line(str,nested) ctxsprint('}') -- Eat the processed characters str = rest + elseif utf.match(str, "^%-%-") then + ctxsprint('{\\italic{--') + -- Recursively call ourselves to handle spaces gracefully. + visualizer.flush_line(utf.sub(str, 3)) + ctxsprint('}}') + -- Done with this line + str = '' else -- Write the first character texwrite(utf.sub(str, 1, 1))