From ab559aeb7dcb42a3eaa45619d1e7c5862483ca48 Mon Sep 17 00:00:00 2001 From: Chris G Date: Sat, 18 Mar 2017 17:00:27 +0000 Subject: [PATCH] fix bug where answers are stripped form DSL --- src/js/crossword_parser.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/js/crossword_parser.js b/src/js/crossword_parser.js index 369900f..2ab2e7d 100644 --- a/src/js/crossword_parser.js +++ b/src/js/crossword_parser.js @@ -564,12 +564,13 @@ if (crossword.errors.length > 0) { specTextWithoutAnswers = crossword.errors.join("\n"); } else { - let spec = generateSpec(crossword); - crossword.spec = spec; + let specWithAnswers = generateSpec(crossword); + crossword.spec = specWithAnswers; + specTextWithAnswers = JSON.stringify(specWithAnswers); - specTextWithAnswers = JSON.stringify(spec); - delete spec['answers']; - specTextWithoutAnswers = JSON.stringify(spec); + let specWithoutAnswers = generateSpec(crossword); + delete specWithoutAnswers['answers']; + specTextWithoutAnswers = JSON.stringify(specWithoutAnswers); } crossword.specTextWithAnswers = specTextWithAnswers; crossword.specTextWithoutAnswers = specTextWithoutAnswers;