1
0
Fork 0

Ensuring url_root will always contain forward slash when concatenated with cref

Trailing slash, if any, is stripped and explicitly added.
tpl
Mike Gerwitz 2013-06-04 22:42:47 -04:00
parent f04c9f24a8
commit 3ef6714551
1 changed files with 2 additions and 2 deletions

4
msgfmt
View File

@ -57,7 +57,7 @@ done
refopar="${opar:+${opar%>} id="ref-\\1" class="ref">}"
# format the commit message, stopping at the diff (if any)
awk -vid="$id" -vurl_root="$url_root" -vcref_errlog="$cref_errlog" '
awk -vid="$id" -vurl_root="${url_root%/}" -vcref_errlog="$cref_errlog" '
# replace commit refs with generated URL (allows linking to prior commits
# without hard-coding the configurable links that could change or be
# relative to where the content is hosted); this will then be processed as a
@ -76,7 +76,7 @@ awk -vid="$id" -vurl_root="$url_root" -vcref_errlog="$cref_errlog" '
printf id"\n" >>cref_errlog
}
gsub(/\[cref:.*?\]/, url_root result)
gsub(/\[cref:.*?\]/, (url_root "/" result))
}
# stop printing at diff