TriviaMD 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/quizzes_v1.rb +1 -2
- data/lib/trivia_parser.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c3b042230b7218be57af4349eb5f5c733eca5fa2e43011e5ab02ead83147d6b
|
4
|
+
data.tar.gz: '028e3233cbbcd451fed7c4fa42ff045d73aa95490bfdb169e25b8822ca5d5e78'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b72e80621bc7826f53b59d354ac09e5c66859c4f82db4295691955f5f80115c2694ba9e553c64fdbe6f68123c2dafc508b44f5e2a732ac69b637c2e21339724
|
7
|
+
data.tar.gz: 22de231eea88b58636967ed3e40fa51c8ceb0c851faf67f6671d44b8a66da07279586641f21e958826cf8ba7657de21f981c85ecf18f2ab2faf282bacabf824d
|
data/lib/quizzes_v1.rb
CHANGED
@@ -40,8 +40,7 @@ class QuizzesV1
|
|
40
40
|
question_text: question["question"],
|
41
41
|
question_type: "multiple_answers_question",
|
42
42
|
neutral_comments: question["reason"],
|
43
|
-
|
44
|
-
incorrect_comments: question["reason"],
|
43
|
+
neutral_comments_html: question["reason"],
|
45
44
|
points_possible: 1
|
46
45
|
}
|
47
46
|
}
|
data/lib/trivia_parser.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'kramdown'
|
2
2
|
|
3
3
|
class TriviaParser
|
4
|
+
include Kramdown::Utils::Html
|
4
5
|
def initialize(file, debug = false)
|
5
6
|
@file = file
|
6
7
|
@debug = debug
|
@@ -9,7 +10,7 @@ class TriviaParser
|
|
9
10
|
def get_event(c)
|
10
11
|
return { type: :event_trivia_header } if c.type == :header && c.options[:level] == 2 && c.options[:raw_text] == "Trivia"
|
11
12
|
return { type: :event_header } if c.type == :header
|
12
|
-
return { type: :event_reason, payload: { reason: c.children.first.value } } if c.type == :p && c.children.first.type == :codespan
|
13
|
+
return { type: :event_reason, payload: { reason: escape_html(c.children.first.value) } } if c.type == :p && c.children.first.type == :codespan
|
13
14
|
return { type: :event_answers, payload: { answers: parse_answers(c) } } if c.type == :ul
|
14
15
|
return { type: :event_question, payload: { question: c.children.first.children.first.value } } if c.type == :blockquote
|
15
16
|
return { type: :no_event }
|