toymaker.git

commit 248eae778bda633539a38437f808ab29feda3dfa

Author: Adam Evyčędo <git@apiote.xyz>

split lines in log over timestamp

 templates/item.html | 5 ++++-


diff --git a/templates/item.html b/templates/item.html
index 6f63b69d3fad19725427b28f9e229a565bdad9c0..2947d85e956eb164b01442f444820cb75f912b72 100644
--- a/templates/item.html
+++ b/templates/item.html
@@ -7,6 +7,9 @@ 	item=$(echo "$1" | head -n1 | cut -d ';' -f3)
 	status=$(echo "$1" | head -n1 | cut -d ';' -f4)
 	content1=$(echo "$1" | head -n1 | cut -d ';' -f5-)
 	content2=$(echo "$1" | tail -n+2)
+
+	content=$(printf '%s\n%s\n' "$content1" "$content2" | sed -E 's/ ([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{9}\+[0-9]{2}:[0-9]{2})/\n\1/g')
+
 	cat <<EOF
 <!DOCTYPE html>
 <html>
@@ -59,7 +62,7 @@ 		printf '\t\t\t'
 	fi
 
 	printf '\t\t\t<code><pre style="border: 1px #aaa solid; padding: 1rem; overflow: scroll; color: #cdb360;">\n'
-	printf '%s\n%s\n' "$content1" "$content2"
+	printf '%s' "$content"
 	printf '\t\t\t</pre></code>\n'
 	cat <<EOF
 		</main>