diff options
-rw-r--r-- | init.lua | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -218,6 +218,7 @@ function dok.dok2html(txt) local anch = {} local code = {} local file = {} + local lang = {} local pict = {} local foot = {} local issection = false; @@ -230,8 +231,9 @@ function dok.dok2html(txt) end) -- note: we do not support code-specific colorization yet - txt = txt:gsub('<file.->(.-)</file>', function(str) + txt = txt:gsub('<file%s-(%w-)>(.-)</file>', function(langstr,str) table.insert(file, str) + table.insert(lang,langstr) return '\019' .. #file .. '\019' end) @@ -501,7 +503,7 @@ function dok.dok2html(txt) end) txt = txt:gsub('\019(%d+)\019', function(id) id = tonumber(id) -- file - return '<pre class="brush: lua;">' .. file[id] .. '</pre>' + return '<pre class="brush: ' .. lang[id].. ';">' .. file[id] .. '</pre>' end) return txt |