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