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:
+1
-1
@@ -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>';"
|
||||||
, " });"
|
, " });"
|
||||||
|
|||||||
Reference in New Issue
Block a user