diff --git a/cms/djangoapps/pipeline_js/js/xmodule.js b/cms/djangoapps/pipeline_js/js/xmodule.js
index 6c44da31f1..96f8f1afa9 100644
--- a/cms/djangoapps/pipeline_js/js/xmodule.js
+++ b/cms/djangoapps/pipeline_js/js/xmodule.js
@@ -32,7 +32,10 @@ define(
['\\[', '\\]'],
['[mathjax]', '[/mathjax]']
]
- }
+ },
+ CommonHTML: { linebreaks: { automatic: true } },
+ SVG: { linebreaks: { automatic: true } },
+ "HTML-CSS": { linebreaks: { automatic: true } },
});
// In order to eliminate all flashing during interactive
@@ -42,6 +45,25 @@ define(
// the fast preview setting as shown in the context menu.
window.MathJax.Hub.processSectionDelay = 0;
window.MathJax.Hub.Configured();
+
+ window.addEventListener('resize', MJrenderer);
+
+ let t = -1;
+ let delay = 1000;
+ let oldWidth = document.documentElement.scrollWidth;
+ function MJrenderer() {
+ // don't rerender if the window is the same size as before
+ if (t >= 0) {
+ window.clearTimeout(t);
+ }
+ if (oldWidth !== document.documentElement.scrollWidth) {
+ t = window.setTimeout(function() {
+ oldWidth = document.documentElement.scrollWidth;
+ MathJax.Hub.Queue(["Rerender", MathJax.Hub]);
+ t = -1;
+ }, delay);
+ }
+ };
}
);
window.CodeMirror = CodeMirror;
diff --git a/cms/templates/content_libraries/xblock_iframe.html b/cms/templates/content_libraries/xblock_iframe.html
index 47966bc4cd..79d0de1409 100644
--- a/cms/templates/content_libraries/xblock_iframe.html
+++ b/cms/templates/content_libraries/xblock_iframe.html
@@ -81,6 +81,12 @@