fix: escape single quotes in JS renderFlatList string

Haskell\'s \' within double-quoted string literals is interpreted as
just \' (no-op escape). Switched to \\' to produce \' in the JS
output, which correctly escapes the single quotes inside the
single-quoted JS string literal for the CSS class name.
This commit is contained in:
2026-05-19 22:00:46 -04:00
parent f74c431588
commit cef407c31b
+1 -1
View File
@@ -254,7 +254,7 @@ searchJs =
, "" , ""
, "function renderFlatList(items) {" , "function renderFlatList(items) {"
, " if (items.length === 0) return '<p>No recipes found.</p>';" , " if (items.length === 0) return '<p>No recipes found.</p>';"
, " let html = '<ul class=\'roux-recipes\'>';" , " let html = '<ul class=\\'roux-recipes\\'>';"
, " items.forEach(r => {" , " items.forEach(r => {"
, " html += '<li><a href=\"/recipes/' + encodeURIComponent(r.filename) + '\">' + escapeHtml(r.title) + '</a></li>';" , " html += '<li><a href=\"/recipes/' + encodeURIComponent(r.filename) + '\">' + escapeHtml(r.title) + '</a></li>';"
, " });" , " });"