"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/plugins/outhtml_ansi_esc.lua" (12 May 2020, 494 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lua source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "outhtml_ansi_esc.lua": 3.54_vs_3.55.

    1 
    2 Description="Replace ANSI Escape character by readable symbols"
    3 
    4 Categories = {"format", "html" }
    5 
    6 -- optional parameter: syntax description
    7 function syntaxUpdate(desc)
    8 
    9   if (HL_OUTPUT ~= HL_FORMAT_HTML and HL_OUTPUT ~= HL_FORMAT_XHTML) then
   10     return
   11   end
   12 
   13 
   14   function Decorate(token)
   15     if token == "\27" then
   16       -- return "<span class=\"hl esc\">ESC</span>"
   17       -- return "&#xFFFD;"
   18       return "&#x9243;"
   19     end
   20 
   21   end
   22 
   23 end
   24 
   25 Plugins={
   26 
   27   { Type="lang", Chunk=syntaxUpdate },
   28 
   29 }