From: Nishi Date: Mon, 30 Sep 2024 05:19:31 +0000 (+0000) Subject: escape stuff X-Git-Url: https://git.chaotic.ninja/gitweb/nishi/?a=commitdiff_plain;h=3ec0da2fe3b0942000c60cd08198c63552b7611c;p=docgen.git escape stuff git-svn-id: file:///raid/svn-personal/docgen/trunk@3 44bc13e5-44cb-984e-b856-1907bf1ada44 --- diff --git a/docgen b/docgen index 87ab0fe..fd4e9b3 100755 --- a/docgen +++ b/docgen @@ -66,7 +66,7 @@ proc start_html {fid title toc dots} { puts $fid " $title" puts $fid " " puts $fid " " - puts $fid " " + puts $fid " " puts $fid "
$title
" puts $fid " Root$links" puts $fid "
" @@ -77,15 +77,15 @@ proc start_html {fid title toc dots} { puts $fid " $toc" puts $fid "
" puts $fid " " - puts $fid "
" } + puts $fid "
" } proc end_html {fid} { global footer DOCGEN_VERSION puts $fid "
" puts $fid "
" - puts $fid "
" + puts $fid "
" puts $fid " Generated using Docgen $DOCGEN_VERSION
" if { "$footer" != "" } { puts $fid " $footer" @@ -120,6 +120,8 @@ proc parse_markdown {path _result} { } else { set hl [exec -keepnewline -ignorestderr enscript --color=1 -whtml -o - -E$codeblock << $code 2>/dev/null] } + set hl "[regsub -all {FONT} "$hl" {SPAN}]" + set hl "[regsub -all {COLOR="([^"]+)"} "$hl" {STYLE="color: \1;"}]" regexp -- {
.+
} "$hl" line set result(body) "$result(body)$line" set codeblock "" @@ -135,6 +137,9 @@ proc parse_markdown {path _result} { } } else { set blank 1 + set line "[regsub -all {\&} "$line" {\&}]" + set line "[regsub -all {<} "$line" {\<}]" + set line "[regsub -all {>} "$line" {\>}]" set line "[regsub -all {\*\*\*(.+)\*\*\*} "$line" {\1}]" set line "[regsub -all {\*\*(.+)\*\*} "$line" {\1}]" set line "[regsub -all {\*(.+)\*} "$line" {\1}]"