@khanacademy/perseus 19.5.0 → 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/index.js CHANGED
@@ -41718,7 +41718,7 @@ const init = function (options) {
41718
41718
 
41719
41719
  // This file is processed by a Rollup plugin (replace) to inject the production
41720
41720
  const libName = "@khanacademy/perseus";
41721
- const libVersion = "19.5.0";
41721
+ const libVersion = "19.6.0";
41722
41722
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
41723
41723
 
41724
41724
  const apiVersion = {
@@ -41831,7 +41831,25 @@ class ArticleRenderer extends React__namespace.Component {
41831
41831
  }
41832
41832
  };
41833
41833
  _sections = () => {
41834
- return Array.isArray(this.props.json) ? this.props.json : [this.props.json];
41834
+ const sections = Array.isArray(this.props.json) ? this.props.json : [this.props.json];
41835
+
41836
+ // In JIPT context we split sections to paragraphs in order match the
41837
+ // translatable strings found on Crowdin when rendering articles in
41838
+ // the WYSIWYG mode for translation. This is needed for the jipt.js
41839
+ // integration in order to attribute the rendered strings on Crowdin.
41840
+ if (getDependencies().JIPT.useJIPT) {
41841
+ const paragraphs = [];
41842
+ for (const section of sections) {
41843
+ JiptParagraphs.parseToArray(section.content).forEach(paragraph => {
41844
+ paragraphs.push({
41845
+ ...section,
41846
+ content: paragraph
41847
+ });
41848
+ });
41849
+ }
41850
+ return paragraphs;
41851
+ }
41852
+ return sections;
41835
41853
  };
41836
41854
  render() {
41837
41855
  const apiOptions = {