diff --git a/msgfmt b/msgfmt index a21f740..8647468 100755 --- a/msgfmt +++ b/msgfmt @@ -20,6 +20,27 @@ # along with this program. If not, see . # # +# 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#

&

#g; # basic formatting - s/---/\—/g; - s#``#\“#g; - s#'\'\''#\”#g; + s/---/'"$mdash"'/g; + s#``#'"$lquo"'#g; + s#'\'\''#'"$rquo"'#g; ' diff --git a/rss b/rss index 821f7b1..0caac1d 100755 --- a/rss +++ b/rss @@ -51,7 +51,7 @@ while read hash commit ts id subject; do # the title) cat < - <![CDATA[$( ./msgfmt < <( echo "$subject"; echo ) )]]> + <![CDATA[$( ./msgfmt -n < <( echo "$subject"; echo ) )]]> $( printf "%s/%s/%s.html" \ "${url/%\/}" "$( ./tsdate "$ts" %Y/%m )" "$id"