commit e6b086134b6db9d9bb801142d2af3b582805767c
parent 4d8ea299730043d8519797ffb0251240e0df20e0
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Fri, 22 Aug 2025 10:20:45 +0200
parent 4d8ea299730043d8519797ffb0251240e0df20e0
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Fri, 22 Aug 2025 10:20:45 +0200
packages/gotosocial-unstable: add patch to remove indentation from rendered values (to fix things like `pre`, `code`)
2 files changed, 43 insertions(+), 1 deletion(-)
A
|
40
++++++++++++++++++++++++++++++++++++++++
diff --git a/packages/gotosocial-unstable/0001-disable-template-indentation.patch b/packages/gotosocial-unstable/0001-disable-template-indentation.patch @@ -0,0 +1,40 @@ +From 319ef126ac07b7dc4d63ab749b2dac7fe155a905 Mon Sep 17 00:00:00 2001 +From: "Katja Ramona Sophie Kwast (zaphyra)" <git@zaphyra.eu> +Date: Fri, 22 Aug 2025 09:46:11 +0200 +Subject: [PATCH] disable template indentation + +--- + internal/router/template.go | 12 ++---------- + 1 file changed, 2 insertions(+), 10 deletions(-) + +diff --git a/internal/router/template.go b/internal/router/template.go +index 860f9aad5..e4d0d99f5 100644 +--- a/internal/router/template.go ++++ b/internal/router/template.go +@@ -323,21 +323,13 @@ func subtract(n1 int, n2 int) int { + // indent appropriately indents the given html + // by prepending each line with the indentStr. + func indent(n int, html template.HTML) template.HTML { +- out := indentRegex.ReplaceAllString( +- string(html), +- indents[:n*indentStrLen], +- ) +- return noescape(out) ++ return html + } + + // indentAttr appropriately indents the given html + // attribute by prepending each line with the indentStr. + func indentAttr(n int, html template.HTMLAttr) template.HTMLAttr { +- out := indentRegex.ReplaceAllString( +- string(html), +- indents[:n*indentStrLen], +- ) +- return noescapeAttr(out) ++ return html + } + + // outdentPreformatted outdents all preformatted text in +-- +2.50.1 +
diff --git a/packages/gotosocial-unstable/package.nix b/packages/gotosocial-unstable/package.nix @@ -25,7 +25,9 @@ unstable.buildGo125Module (finalAttrs: { hash = finalAttrs.srcHash; inherit (finalAttrs) rev; }; - patches = [ ]; + patches = [ + ./0001-disable-template-indentation.patch + ]; }; frontend-assets = mkYarnPackage {