feat: new default style and more
All checks were successful
Lint / shellcheck (push) Successful in 20s
All checks were successful
Lint / shellcheck (push) Successful in 20s
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
BEGIN { in_code = 0 }
|
||||
/^ | / {
|
||||
if (!in_code) { print "<pre><code>"; in_code = 1 }
|
||||
sub(/^ | /, "", $0)
|
||||
gsub(/&/, "\\&"); gsub(/</, "\\<"); gsub(/>/, "\\>")
|
||||
print; next
|
||||
BEGIN { in_code = 0; in_html_pre = 0 }
|
||||
{
|
||||
if ($0 ~ /<pre>/) in_html_pre = 1
|
||||
if ($0 ~ /<\/pre>/) { in_html_pre = 0; if (in_code) { print "</code></pre>"; in_code = 0 }; print; next }
|
||||
|
||||
if (!in_html_pre && $0 ~ /^(\t| )/) {
|
||||
if (!in_code) { printf "%s", "<pre><code>"; in_code = 1 }
|
||||
sub(/^(\t| )/, "", $0)
|
||||
gsub(/&/, "\\&"); gsub(/</, "\\<"); gsub(/>/, "\\>")
|
||||
print
|
||||
next
|
||||
}
|
||||
|
||||
if (in_code) {
|
||||
print "</code></pre>"
|
||||
in_code = 0
|
||||
}
|
||||
print
|
||||
}
|
||||
{ if (in_code) { print "</code></pre>"; in_code = 0 } print }
|
||||
END { if (in_code) print "</code></pre>" }
|
||||
|
||||
Reference in New Issue
Block a user