mirror of https://github.com/zcash/zips.git
edithtml.sh: argument quoting.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
673be69531
commit
d0d4abac2e
|
@ -15,7 +15,7 @@ if [ "x$1" = "x--rst" ]; then
|
|||
sed -i.sedbak 's|</head>|<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="css/style.css"></head>|' $2
|
||||
sed -i.sedbak 's|http://cdn.mathjax.org/mathjax/latest/MathJax.js|https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js|' $2
|
||||
else
|
||||
cat - $2 >$2.prefix <<EOF
|
||||
cat - "$2" >"$2".prefix <<EOF
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
@ -26,14 +26,14 @@ else
|
|||
</head>
|
||||
<body>
|
||||
EOF
|
||||
cat $2.prefix - >$2 <<EOF
|
||||
cat "$2.prefix" - >"$2" <<EOF
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
rm -f $2.prefix
|
||||
rm -f "$2".prefix
|
||||
fi
|
||||
|
||||
sed -i.sedbak 's|<a href="\([^":]*\).rst">|<a href="\1">|g' $2
|
||||
sed -i.sedbak 's|<a href="\([^":]*\).rst">|<a href="\1">|g' "$2"
|
||||
|
||||
perl -i.sedbak -p0e 's|<section id="([^"]*)">\s*.?\s*<h([1-9])>([^<]*(?:<code>[^<]*</code>[^<]*)?)</h([1-9])>|<section id="\1"><h\2><span class="section-heading">\3</span><span class="section-anchor"> <a href="#\1"><img width="24" height="24" src="assets/images/section-anchor.png" alt=""></a></span></h\4>|g' "$2"
|
||||
|
||||
|
|
Loading…
Reference in New Issue