From 4ae6cebca7aa2d28bbd722856cca259d564a2f13 Mon Sep 17 00:00:00 2001 From: Kyle Buller Date: Mon, 5 Aug 2024 17:00:32 -0500 Subject: [PATCH] Don't escape _ in code blocks in the changelog --- release.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/release.sh b/release.sh index e232b0d..5a86a92 100755 --- a/release.sh +++ b/release.sh @@ -2432,9 +2432,11 @@ else $changelog_url $changelog_previous EOF + # ignore sed matching backticks + # shellcheck disable=SC2016 git -C "$topdir" log "$_changelog_range" --pretty=format:"###%B" \ | sed -e 's/^/ /g' -e 's/^ *$//g' -e 's/^ ###/- /g' -e 's/$/ /' \ - -e 's/\([a-zA-Z0-9]\)_\([a-zA-Z0-9]\)/\1\\_\2/g' \ + -e 's/`[^`]*`|\([a-zA-Z0-9]\)_\([a-zA-Z0-9]\)/\1\\_\2/g' \ -e 's/\[ci skip\]//g' -e 's/\[skip ci\]//g' \ -e '/git-svn-id:/d' -e '/^[[:space:]]*This reverts commit [0-9a-f]\{40\}\.[[:space:]]*$/d' \ -e '/^[[:space:]]*$/d' \ @@ -2474,11 +2476,13 @@ else EOF _svn_changelog=$( retry svn log "$topdir" "$_changelog_range" --xml ) + # ignore sed matching backticks + # shellcheck disable=SC2016 echo "$_svn_changelog" \ | awk '//,/<\/msg>/' \ | sed -e 's//###/g' -e 's/<\/msg>//g' \ -e 's/^/ /g' -e 's/^ *$//g' -e 's/^ ###/- /g' -e 's/$/ /' \ - -e 's/\([a-zA-Z0-9]\)_\([a-zA-Z0-9]\)/\1\\_\2/g' \ + -e 's/`[^`]*`|\([a-zA-Z0-9]\)_\([a-zA-Z0-9]\)/\1\\_\2/g' \ -e 's/\[ci skip\]//g' -e 's/\[skip ci\]//g' \ -e '/^[[:space:]]*$/d' \ | line_ending_filter >> "$changelog_path"