X-Git-Url: http://nsz.repo.hu/git/?p=c-standard;a=blobdiff_plain;f=ann2html.sh;h=5a93b3542d311fb02ef012b47359eac40e8dbdac;hp=a4c127c5fddf3f0baa128a81387c1fd225ec589e;hb=5d87c6a24b31ceb8a6753667546b0cb311bd6843;hpb=6fa09ff7f9eb20582513c80f0fa883b056bde241 diff --git a/ann2html.sh b/ann2html.sh index a4c127c..5a93b35 100755 --- a/ann2html.sh +++ b/ann2html.sh @@ -8,12 +8,16 @@ BEGIN { ss[sid] = "
" } -{ +function esc() { gsub(/\&/, "\\&") gsub(/, "\\<") gsub(/>/, "\\>") } +{ + esc() +} + !title && /^[^@]/ { title = $0 gsub(/ +/, " ", title) @@ -35,6 +39,7 @@ seencontents && !seenfore && /^[^@]/ { s = $0 if (!sub(/ +\. .*/, "", s)) { getline + esc() sub(/^ */, " ") s = s $0 sub(/ +\. .*/, "", s) @@ -78,6 +83,7 @@ seencontents && !seenfore && /^[^@]/ { } sid++ getline + esc() ss[sid] = ss[sid] "" $0 "
\n" if (!seencontents) { ss[sid] = ss[sid] "\n" @@ -96,6 +102,7 @@ seencontents && !seenfore && /^[^@]/ { slevel = 5 sect = $2 getline + esc() # todo hX, back to top ss[sid] = sprintf("%s \n", slevel, sect, sect, $0, slevel) if ($0 == "Index") @@ -261,6 +268,7 @@ END { } print s } + print "Contents" } print "