@khanacademy/perseus 19.5.1 → 19.6.0

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/es/index.js CHANGED
@@ -41580,7 +41580,7 @@ const init = function init(options) {
41580
41580
 
41581
41581
  // This file is processed by a Rollup plugin (replace) to inject the production
41582
41582
  const libName = "@khanacademy/perseus";
41583
- const libVersion = "19.5.1";
41583
+ const libVersion = "19.6.0";
41584
41584
  addLibraryVersionToPerseusDebug(libName, libVersion);
41585
41585
 
41586
41586
  const apiVersion = {
@@ -41682,7 +41682,24 @@ class ArticleRenderer extends React.Component {
41682
41682
  }
41683
41683
  };
41684
41684
  this._sections = () => {
41685
- return Array.isArray(this.props.json) ? this.props.json : [this.props.json];
41685
+ const sections = Array.isArray(this.props.json) ? this.props.json : [this.props.json];
41686
+
41687
+ // In JIPT context we split sections to paragraphs in order match the
41688
+ // translatable strings found on Crowdin when rendering articles in
41689
+ // the WYSIWYG mode for translation. This is needed for the jipt.js
41690
+ // integration in order to attribute the rendered strings on Crowdin.
41691
+ if (getDependencies().JIPT.useJIPT) {
41692
+ const paragraphs = [];
41693
+ for (const section of sections) {
41694
+ JiptParagraphs.parseToArray(section.content).forEach(paragraph => {
41695
+ paragraphs.push(_extends({}, section, {
41696
+ content: paragraph
41697
+ }));
41698
+ });
41699
+ }
41700
+ return paragraphs;
41701
+ }
41702
+ return sections;
41686
41703
  };
41687
41704
  }
41688
41705
  componentDidMount() {