diff --git a/msgfmt b/msgfmt index 3140f57..9937e01 100755 --- a/msgfmt +++ b/msgfmt @@ -44,6 +44,9 @@ done # format the commit message, stopping at the diff (if any) awk '/^diff --git/ { exit } { print }' \ | sed ':a;N;$!ba; + # handle <>-delimited links (strip delimiters) + s#<\([fh]ttps\?://[^ ]\+\)>#\1#g; + # escaping s/\&/\&/g; s/\</g; @@ -54,10 +57,9 @@ awk '/^diff --git/ { exit } { print }' \ s#\n\n \+\(\([^\n]\+\n\(\n \+\)\?\)\+\)#
\1#g # unfortunately, non-greedy matches make it difficult to exclude punctuation - # at the end of a link, so we will not be handling it here (since links - # should always be in the footer as references (ideally), this should not - # happen + # at the end of a link, so we will handle it in a separate expression s#[fh]ttps\?://[^]\n )]\+#&#g; + s#\([^<]\+\).#\3\2#g; # reference definitions (footnotes) s#\n\[\([0-9]\+\)\]#
g;