diff options
Diffstat (limited to 'lib/parse')
-rw-r--r-- | lib/parse/renderer.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/parse/renderer.js b/lib/parse/renderer.js index f467c23..e6854f2 100644 --- a/lib/parse/renderer.js +++ b/lib/parse/renderer.js @@ -118,8 +118,10 @@ GitBookRenderer.prototype._createCheckboxAndRadios = function(text) { if (!match) { return text; } - var quizIdentifier = 'quiz-row-' + this.id + '-' + this.quizRowId + '-' + this.quizIndex++; - var field = "<input name='" + quizIdentifier + "' id='" + quizIdentifier + "' type='"; + //fix radio input uncheck failed + var quizFieldName='quiz-row-' + this.id + '-' + this.quizRowId ; + var quizIdentifier = quizFieldName + '-' + this.quizIndex++; + var field = "<input name='" + quizFieldName + "' id='" + quizIdentifier + "' type='"; field += match[1] === '(' ? "radio" : "checkbox"; field += match[2] === 'x' ? "' checked/>" : "'/>"; var splittedText = text.split(fieldRegex); |