@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/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
- // $FlowFixMe[incompatible-type]
20770
- parse: (capture, state, parse) => capture[3]
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
- // $FlowFixMe[incompatible-type]
20776
- parse: (capture, state, parse) => capture[1]
20778
+ parse: (capture, state, parse) => ({
20779
+ content: capture[1]
20780
+ })
20777
20781
  }
20778
- }; // $FlowFixMe[prop-missing]
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