Skip to content

Commit

Permalink
Longer demo text (repeat it 10 times).
Browse files Browse the repository at this point in the history
Exposes a syntax highlight bug - most of the lext looks literal -
probably a defineMathMode() is at fault.
  • Loading branch information
cben committed Sep 3, 2015
1 parent 2e5a9fa commit 7343c8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CodeMirror
10 changes: 9 additions & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</script>
<!-- Safe extension (http://docs.mathjax.org/en/latest/safe-mode.html)
only needed if editor content may be controlled by other users. -->
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full,Safe"></script>
<script src="../MathJax/MathJax.js?config=TeX-AMS_HTML-full,Safe"></script>
</head>
<body>
<h1>attempt at CodeMirror + in-place MathJax</h1>
Expand Down Expand Up @@ -118,6 +118,9 @@ <h1>attempt at CodeMirror + in-place MathJax</h1>
xXxXxXxXxXxXxXxXxXxXxXxX
$$\sum^b_c \frac{1}{a}$$
xXxXxXxXxXxXxXxXxXxXxXxX

--------------------------------------------------------------------------------

</textarea></form>
<script>
CodeMirror.defineMathMode("markdown+math", {name: "markdown",
Expand All @@ -126,6 +129,11 @@ <h1>attempt at CodeMirror + in-place MathJax</h1>
{lineNumbers: true,
lineWrapping: true,
mode: "markdown+math"});
var text = editor.getValue(), repeatedText = "";
for(var i = 0; i < 10; i++) {
repeatedText += text;
}
editor.setValue(repeatedText);
CodeMirror.hookMath(editor, MathJax);
editor.renderAllMath();
</script>
Expand Down

0 comments on commit 7343c8c

Please sign in to comment.