escaping eventual '&'
(otherwise causing a bug where it is replaced by '<\!-- TITLE -->')
This commit is contained in:
parent
12b22a1e07
commit
dcb085accb
1 changed files with 4 additions and 2 deletions
|
|
@ -36,7 +36,7 @@ fi
|
||||||
|
|
||||||
# get the current date for the footer (UTC and ISO 8601 with hours and minutes)
|
# get the current date for the footer (UTC and ISO 8601 with hours and minutes)
|
||||||
date=$(date -u --iso-8601=minutes)
|
date=$(date -u --iso-8601=minutes)
|
||||||
sed "s/GEN_DATE/$date/" html/footer.html > "$tempdir/footer.html"
|
sed "s/GEN_DATE/${date}/" html/footer.html > "$tempdir/footer.html"
|
||||||
|
|
||||||
|
|
||||||
# finding recursively all ".gmi" files on the working path
|
# finding recursively all ".gmi" files on the working path
|
||||||
|
|
@ -45,10 +45,12 @@ do
|
||||||
|
|
||||||
# deleting the '#' of the first line and save it as title
|
# deleting the '#' of the first line and save it as title
|
||||||
title="$(sed -n '1{s/# //p}' "$gmi_file") $2"
|
title="$(sed -n '1{s/# //p}' "$gmi_file") $2"
|
||||||
|
# escaping eventual '&' (otherwise causing a bug where it is replaced by '<\!-- TITLE -->')
|
||||||
|
title=$(echo "$title" | sed "s#&#\\\&#g")
|
||||||
|
|
||||||
# in the header.html, replacing the "<\-- TITLE -->" by the previously
|
# in the header.html, replacing the "<\-- TITLE -->" by the previously
|
||||||
# saved title, and save the modified file in our temporary directory
|
# saved title, and save the modified file in our temporary directory
|
||||||
sed "s#<\!-- TITLE -->#$title#" html/header.html > "$tempdir/header.html"
|
sed "s#<\!-- TITLE -->#${title}#" html/header.html > "$tempdir/header.html"
|
||||||
|
|
||||||
# convertig .gmi files in .html
|
# convertig .gmi files in .html
|
||||||
/usr/local/bin/gmnitohtml < "$gmi_file" > "$tempdir/body.html"
|
/usr/local/bin/gmnitohtml < "$gmi_file" > "$tempdir/body.html"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue