From dc336db70869ffc0205d504d23b1c6d30930adf6 Mon Sep 17 00:00:00 2001 From: gator Date: Tue, 15 Sep 2026 02:26:12 +0000 Subject: [PATCH] Repair the page a bad patch doubled, and fix the price properly My previous patch put a dollar sign next to a quote in the REPLACEMENT text. That is a substitution token, so the whole rest of the file was spliced in and script.html went from 82KB to 148KB with render() cut in half. Writing it as a $ escape did not avoid it either - that is decoded before the substitution runs and springs exactly the same trap. - The broken line is restored, with the currency sign as the HTML entity $ which contains no dollar character at all. - The spliced duplicate is commented out to end of file. The live copy is the one above it, so every future anchor still matches the live code first. - Price now comes from the fresh quote get_project returns rather than the price_usd stamped on the row at creation, which ignored the markup change. Patch order matters here: the corrected line itself contains the fragment text, so the fragment is dealt with first. --- script.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/script.html b/script.html index 302add4..69efac8 100644 --- a/script.html +++ b/script.html @@ -282,7 +282,13 @@ function render(r) { // Built from a code point so no dollar sign sits against a quote in this // file's patch text - that sequence is a substitution token to // patch_git_file and once shipped a broken page (BROWSER_TESTS.md:265). - + '
' + ' + // The price as the server computes it NOW. price_usd is stamped on the row + // when the project is created, so it goes stale the moment the markup + // constant changes - which it just did, from 5x to actual cost. + var price = (r.quote && typeof r.quote.price_usd === 'number') + ? r.quote.price_usd : Number(p.price_usd || 0); + + + '
$' + Number(price).toFixed(2) + '
' + '
' + videoSecondsOf(p) + ' seconds · ' + (p.segments || 4) + ' shots' + (modelFor(p) ? ' · ' + esc(modelFor(p).label) : '') + '
' + '
' + (canEditScript @@ -1660,7 +1666,11 @@ load(); - + Number(price).toFixed(2) + '
' + +