From 6f085ffa6d12a0e1ed9846c93ffdc6b456776902 Mon Sep 17 00:00:00 2001 From: Gunter Labes Date: Mon, 10 Mar 2025 23:13:41 +0100 Subject: [PATCH] Avoid indentation so the embedded html is parsed right Use one html line per map. --- .github/workflows/map-diff.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/map-diff.yml b/.github/workflows/map-diff.yml index 745d132c1c6..5a8348d2511 100644 --- a/.github/workflows/map-diff.yml +++ b/.github/workflows/map-diff.yml @@ -60,12 +60,11 @@ jobs: json=$(curl -s -F image=@diff_image.png https://api.imgur.com/3/upload | tee /dev/stderr) log 'Generating HTML comment...' - html=$(printf %s "$json" | jq -rRs --arg path "$map_path" --arg dim "$old_dim -> $new_dim" '. as $input | - try fromjson catch ({error:$input}) | @html " -

\($path)

dimensions: \($dim)

- \"\(if
-
imgur response

\(tojson)

"') - comment_body+=$html + # careful with leading spaces in the output since it is ultimately markdown (with embedded html) so the indentation may have meaning + html=$(printf %s "$json" | jq -rRs --arg path "$map_path" --arg dim "$old_dim ➔ $new_dim" '. as $input | + try fromjson catch ({error:$input}) | (if .data.link then "map diff image" else "image upload failed" end) as $alt | + @html "

\($path)

dimensions: \($dim)

\"\($alt)\"/
imgur response

\(tojson)

"') + comment_body+=$html$'\n' done [[ $comment_body ]] || err Failed to generate comment