regexp escape sequence `\"' is not a known regexp operator for gawk

This commit is contained in:
Nero 2023-05-09 10:56:05 +00:00
parent 6c831dc78f
commit a59d19fa3d

10
md2html
View File

@ -63,7 +63,7 @@ function escape(text) {
gsub(/&/, "\\&", text)
gsub(/</, "\\&lt;", text)
gsub(/>/, "\\&gt;", text)
gsub(/\"/, "\\&quot;", text)
gsub(/"/, "\\&quot;", text)
return text
}
@ -237,7 +237,7 @@ function escape(text) {
gsub(/&/, "\\&amp;", text)
gsub(/</, "\\&lt;", text)
gsub(/>/, "\\&gt;", text)
gsub(/\"/, "\\&quot;", text)
gsub(/"/, "\\&quot;", text)
return text
}
@ -252,7 +252,7 @@ function inline(text) {
/<body lang=/ {
lang=$0
gsub(/^.*lang=\"*/,"",lang)
gsub(/^.*lang="*/,"",lang)
gsub(/[^a-z].*$/,"",lang)
level("summary")
oneliner("h2", tocname[lang])
@ -260,8 +260,8 @@ function inline(text) {
/<h[2-6] / {
id=$0
gsub(/^.*id=\"/,"",id)
gsub(/\">.*$/,"",id)
gsub(/^.*id="/,"",id)
gsub(/">.*$/,"",id)
d=$1
gsub(/^<h/, "", d)
gsub(/ *<[^>]*>/, "", $0)