Commit b36cbf9
fix: minify OG HTML templates to eliminate whitespace text nodes
Satori's HTML parser (via HTMLRewriter) treats whitespace between
elements as text nodes. Template literal formatting creates newlines
and indentation that become phantom children, violating Satori's
strict "display: flex" requirement even when the div already has it.
Added minifyHtml() helper that strips whitespace between tags
(/>\\s+</g -> "><"). Applied to both generateOgHtml and
generateDefaultOgHtml return values. Templates stay readable,
output is minified.
Build: 18.23s ✅
Co-authored-by: seniordeveloper <seniordeveloper@miriad.systems>1 parent b27f96c commit b36cbf9
1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| |||
133 | 141 | | |
134 | 142 | | |
135 | 143 | | |
136 | | - | |
| 144 | + | |
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
| |||
206 | 214 | | |
207 | 215 | | |
208 | 216 | | |
209 | | - | |
| 217 | + | |
210 | 218 | | |
211 | 219 | | |
212 | 220 | | |
| |||
232 | 240 | | |
233 | 241 | | |
234 | 242 | | |
235 | | - | |
| 243 | + | |
236 | 244 | | |
237 | 245 | | |
238 | 246 | | |
| |||
285 | 293 | | |
286 | 294 | | |
287 | 295 | | |
288 | | - | |
| 296 | + | |
289 | 297 | | |
0 commit comments