diff options
author | koray kavukcuoglu <koray@kavukcuoglu.org> | 2012-02-09 06:20:46 +0400 |
---|---|---|
committer | koray kavukcuoglu <koray@kavukcuoglu.org> | 2012-02-09 06:20:46 +0400 |
commit | 6c0511b67f2a522317fac06148d8f0ff6128eb7c (patch) | |
tree | 90b0305b59194d50e78151c2a40b05ad852529d5 | |
parent | 598592409abb522577d0a74db07c2543707cb2ec (diff) |
add Bash/Shell highlighting.
-rw-r--r-- | init.lua | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -231,7 +231,7 @@ function dok.dok2html(txt) end) -- note: we do not support code-specific colorization yet - txt = txt:gsub('<file%s-(%w-)>(.-)</file>', function(langstr,str) + txt = txt:gsub('<file%s-(%w-)%s->(.-)</file>', function(langstr,str) table.insert(file, str) table.insert(lang,langstr) return '\019' .. #file .. '\019' @@ -503,7 +503,8 @@ function dok.dok2html(txt) end) txt = txt:gsub('\019(%d+)\019', function(id) id = tonumber(id) -- file - return '<pre class="brush: ' .. lang[id].. ';">' .. file[id] .. '</pre>' + local lng = lang[id] or 'lua' + return '<pre class="brush: ' .. lng .. ';">' .. file[id] .. '</pre>' end) return txt |