regexp escape sequence `\"' is not a known regexp operator for gawk
This commit is contained in:
parent
6c831dc78f
commit
a59d19fa3d
12
md2html
12
md2html
@ -63,7 +63,7 @@ function escape(text) {
|
|||||||
gsub(/&/, "\\&", text)
|
gsub(/&/, "\\&", text)
|
||||||
gsub(/</, "\\<", text)
|
gsub(/</, "\\<", text)
|
||||||
gsub(/>/, "\\>", text)
|
gsub(/>/, "\\>", text)
|
||||||
gsub(/\"/, "\\"", text)
|
gsub(/"/, "\\"", text)
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ function escape(text) {
|
|||||||
gsub(/&/, "\\&", text)
|
gsub(/&/, "\\&", text)
|
||||||
gsub(/</, "\\<", text)
|
gsub(/</, "\\<", text)
|
||||||
gsub(/>/, "\\>", text)
|
gsub(/>/, "\\>", text)
|
||||||
gsub(/\"/, "\\"", text)
|
gsub(/"/, "\\"", text)
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,13 +246,13 @@ function inline(text) {
|
|||||||
text = gensub(/\*\*([^\*]*)\*\*/, "<strong>\\1</strong>", "g", text)
|
text = gensub(/\*\*([^\*]*)\*\*/, "<strong>\\1</strong>", "g", text)
|
||||||
text = gensub(/\*([^\*]*)\*/, "<em>\\1</em>", "g", text)
|
text = gensub(/\*([^\*]*)\*/, "<em>\\1</em>", "g", text)
|
||||||
text = gensub(/`([^`]*)`/, "<code>\\1</code>", "g", text)
|
text = gensub(/`([^`]*)`/, "<code>\\1</code>", "g", text)
|
||||||
text = gensub(/\[(.*)\]\((.*)\)/, "<a href=\"\\2\">\\1</a>", "g", text)
|
text = gensub(/\[(.*)\]\((.*)\)/, "<a href=\"\\2\">\\1</a>", "g", text)
|
||||||
return text
|
return 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)
|
||||||
|
Loading…
Reference in New Issue
Block a user