EDU-718 Multiline code part with <br> tags inside displays in one line in Task Descri...
authorValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Mon, 8 Aug 2016 11:08:35 +0000 (14:08 +0300)
committerValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Mon, 8 Aug 2016 11:14:53 +0000 (14:14 +0300)
python/educational-core/student/resources/code-mirror/template.html

index ff4e21866b8c236e95d03d9e3a77ca5678a3ad2e..86c239218f22b055de0a1c0fda46173e39eee8af 100644 (file)
@@ -22,7 +22,7 @@
   <!--suppress CssInvalidPropertyValue -->
   <style media="screen" type="text/css">
     body {
-      font-size: ${font_size}pt !important;
+      font-size: ${font_size} pt !important;
     }
 
   </style>
 ${code}
 <script>
   var nodeList = document.body.getElementsByTagName("code");
-  CodeMirror.colorize(nodeList, "${default_mode}")
+  nodes = Array.prototype.slice.call(nodeList, 0);
+  
+  nodes.forEach(function (node) {
+    var text = node.innerHTML
+    node.innerHTML = text.replace(/<br\s*>/g, '\n')
+  });
+
+  CodeMirror.colorize(nodeList, "python")
   CodeMirror.colorize();
 </script>
 </body>