mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-13 05:53:07 +00:00
Avoid indentation so the embedded html is parsed right
Use one html line per map.
This commit is contained in:
parent
bd6f250c12
commit
6f085ffa6d
11
.github/workflows/map-diff.yml
vendored
11
.github/workflows/map-diff.yml
vendored
|
@ -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 "
|
||||
<h3>\($path)</h3><p>dimensions: \($dim)</p>
|
||||
<img src=\"\(.data.link)\" alt=\"\(if .data.link then "map diff image" else "image upload failed" end)\"/><br/>
|
||||
<details><summary>imgur response</summary><p>\(tojson)</p></details>"')
|
||||
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 "<h3>\($path)</h3><p>dimensions: \($dim)</p><img src=\"\(.data.link)\" alt=\"\($alt)\"/><br/><details><summary>imgur response</summary><p>\(tojson)</p></details>"')
|
||||
comment_body+=$html$'\n'
|
||||
done
|
||||
|
||||
[[ $comment_body ]] || err Failed to generate comment
|
||||
|
|
Loading…
Reference in New Issue
Block a user