From 609f386c9f236f9db16e3f7b5152b44ab263f963 Mon Sep 17 00:00:00 2001 From: Sam Zeidman Date: Thu, 31 Oct 2019 09:02:03 -0400 Subject: [PATCH] Fix rendering of ampersands in clues in generated puzzles. --- files.js | 7 +++---- index.html | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files.js b/files.js index 2aa9960..9091a47 100644 --- a/files.js +++ b/files.js @@ -448,13 +448,12 @@ function generatePDFClues() { let [i, j, direction] = key.split(","); const cell = grid.querySelector('[data-row="' + i + '"]').querySelector('[data-col="' + j + '"]'); let label = Number(cell.firstChild.innerHTML); + let clue = xw.clues[key].replace(/&/g, '&'); if (direction == ACROSS) { - // acrossClues.push([label, xw.clues[key], getWordAt(i, j, direction)]); - // acrossClues.sort(byLabel); - acrossClues.push({ "label": label, "clue": xw.clues[key], "answer": getWordAt(i, j, direction)}); + acrossClues.push({ "label": label, "clue": clue, "answer": getWordAt(i, j, direction)}); acrossClues.sort(byLabel); } else { - downClues.push({ "label": label, "clue": xw.clues[key], "answer": getWordAt(i, j, direction)}); + downClues.push({ "label": label, "clue": clue, "answer": getWordAt(i, j, direction)}); downClues.sort(byLabel); } } diff --git a/index.html b/index.html index 1d98986..efb655e 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,6 @@ + Phil - a free crossword maker