diff options
author | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-10-13 15:55:59 +0200 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-10-13 15:55:59 +0200 |
commit | 84d7662fd8a2d1abfd0feb92f54064e5d9b9d072 (patch) | |
tree | 3f668e429d2fc2d90e4f0324f955126cf19a6dfe /lib/parse | |
parent | 676b2287ee2595843daa18bee4effeb6f021b2ed (diff) | |
download | gitbook-84d7662fd8a2d1abfd0feb92f54064e5d9b9d072.zip gitbook-84d7662fd8a2d1abfd0feb92f54064e5d9b9d072.tar.gz gitbook-84d7662fd8a2d1abfd0feb92f54064e5d9b9d072.tar.bz2 |
Allow quiz titles in validation
Diffstat (limited to 'lib/parse')
-rw-r--r-- | lib/parse/is_quiz.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/parse/is_quiz.js b/lib/parse/is_quiz.js index 4a24cfc..3322ff0 100644 --- a/lib/parse/is_quiz.js +++ b/lib/parse/is_quiz.js @@ -68,7 +68,12 @@ function splitQuestions(nodes) { function isQuiz(nodes) { // Extract potential questions - var questions = splitQuestions(nodes); + var questions = splitQuestions( + // Skip quiz title if there + nodes.slice( + (nodes[0] && nodes[0].type) === 'paragraph' ? 1 : 0 + ) + ); // Nothing that looks like questions if(questions.length === 0) { |