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/>.
|
||||
# #
|
||||
|
||||
# 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)
|
||||
awk '/^diff --git/ { exit } { print }' \
|
||||
| sed ':a;N;$!ba;
|
||||
|
@ -45,7 +66,7 @@ awk '/^diff --git/ { exit } { print }' \
|
|||
s#\n\n#</p>&<p>#g;
|
||||
|
||||
# basic formatting
|
||||
s/---/\—/g;
|
||||
s#``#\“#g;
|
||||
s#'\'\''#\”#g;
|
||||
s/---/'"$mdash"'/g;
|
||||
s#``#'"$lquo"'#g;
|
||||
s#'\'\''#'"$rquo"'#g;
|
||||
'
|
||||
|
|
2
rss
2
rss
|
@ -51,7 +51,7 @@ while read hash commit ts id subject; do
|
|||
# the title)
|
||||
cat <<EOE
|
||||
<item>
|
||||
<title><![CDATA[$( ./msgfmt < <( echo "$subject"; echo ) )]]></title>
|
||||
<title><![CDATA[$( ./msgfmt -n < <( echo "$subject"; echo ) )]]></title>
|
||||
<link>$(
|
||||
printf "%s/%s/%s.html" \
|
||||
"${url/%\/}" "$( ./tsdate "$ts" %Y/%m )" "$id"
|
||||
|
|
Loading…
Reference in New Issue