RSS feed no longer outputs HTML entities in the title
parent
81356e4104
commit
ff237bbc6f
27
msgfmt
27
msgfmt
|
@ -20,6 +20,27 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# #
|
# #
|
||||||
|
|
||||||
|
# HTML replacements (default)
|
||||||
|
lquo='\“'
|
||||||
|
rquo='\”'
|
||||||
|
mdash='\—'
|
||||||
|
|
||||||
|
# redefines replacements to yield plain text (instead of HTML entities)
|
||||||
|
nohtml()
|
||||||
|
{
|
||||||
|
lquo=\"
|
||||||
|
rquo=\"
|
||||||
|
mdash=---
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
while getopts n opt; do
|
||||||
|
case "$opt" in
|
||||||
|
n) nohtml;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# format the commit message, stopping at the diff (if any)
|
# format the commit message, stopping at the diff (if any)
|
||||||
awk '/^diff --git/ { exit } { print }' \
|
awk '/^diff --git/ { exit } { print }' \
|
||||||
| sed ':a;N;$!ba;
|
| sed ':a;N;$!ba;
|
||||||
|
@ -45,7 +66,7 @@ awk '/^diff --git/ { exit } { print }' \
|
||||||
s#\n\n#</p>&<p>#g;
|
s#\n\n#</p>&<p>#g;
|
||||||
|
|
||||||
# basic formatting
|
# basic formatting
|
||||||
s/---/\—/g;
|
s/---/'"$mdash"'/g;
|
||||||
s#``#\“#g;
|
s#``#'"$lquo"'#g;
|
||||||
s#'\'\''#\”#g;
|
s#'\'\''#'"$rquo"'#g;
|
||||||
'
|
'
|
||||||
|
|
2
rss
2
rss
|
@ -51,7 +51,7 @@ while read hash commit ts id subject; do
|
||||||
# the title)
|
# the title)
|
||||||
cat <<EOE
|
cat <<EOE
|
||||||
<item>
|
<item>
|
||||||
<title><![CDATA[$( ./msgfmt < <( echo "$subject"; echo ) )]]></title>
|
<title><![CDATA[$( ./msgfmt -n < <( echo "$subject"; echo ) )]]></title>
|
||||||
<link>$(
|
<link>$(
|
||||||
printf "%s/%s/%s.html" \
|
printf "%s/%s/%s.html" \
|
||||||
"${url/%\/}" "$( ./tsdate "$ts" %Y/%m )" "$id"
|
"${url/%\/}" "$( ./tsdate "$ts" %Y/%m )" "$id"
|
||||||
|
|
Loading…
Reference in New Issue