@khanacademy/perseus 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/es/index.js +11 -6
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/jipt-paragraphs_test.js +34 -0
- package/src/jipt-paragraphs.js +16 -8
package/dist/index.js
CHANGED
|
@@ -20766,17 +20766,20 @@ const arrayRules = {
|
|
|
20766
20766
|
fence: {
|
|
20767
20767
|
match: SimpleMarkdown__default["default"].defaultRules.fence.match,
|
|
20768
20768
|
order: 1,
|
|
20769
|
-
|
|
20770
|
-
|
|
20769
|
+
parse: (capture, state, parse) => ({
|
|
20770
|
+
type: "codeBlock",
|
|
20771
|
+
lang: capture[2] || undefined,
|
|
20772
|
+
content: capture[3]
|
|
20773
|
+
})
|
|
20771
20774
|
},
|
|
20772
20775
|
paragraph: {
|
|
20773
20776
|
match: SimpleMarkdown__default["default"].defaultRules.paragraph.match,
|
|
20774
20777
|
order: 2,
|
|
20775
|
-
|
|
20776
|
-
|
|
20778
|
+
parse: (capture, state, parse) => ({
|
|
20779
|
+
content: capture[1]
|
|
20780
|
+
})
|
|
20777
20781
|
}
|
|
20778
|
-
};
|
|
20779
|
-
|
|
20782
|
+
};
|
|
20780
20783
|
const builtArrayParser = SimpleMarkdown__default["default"].parserFor(arrayRules); // This should just return an array of strings! magick!
|
|
20781
20784
|
|
|
20782
20785
|
const parseToArray = source => {
|
|
@@ -20787,6 +20790,8 @@ const parseToArray = source => {
|
|
|
20787
20790
|
const paragraphedSource = source.replace(/^\n\s*\n/, "") + "\n\n";
|
|
20788
20791
|
return builtArrayParser(paragraphedSource, {
|
|
20789
20792
|
inline: false
|
|
20793
|
+
}).map(c => {
|
|
20794
|
+
return c["content"];
|
|
20790
20795
|
});
|
|
20791
20796
|
};
|
|
20792
20797
|
|