Skip to content

Commit 1766e2f

Browse files
committed
是
1 parent c4563bf commit 1766e2f

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

‎_includes/themes/twitter/default.html‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,30 @@
7171
{% include JB/analytics %}
7272
{% include JB/MathJax %}
7373
<script>
74-
74+
function mdupdate() {
75+
76+
var tmp = $("#content").html();
77+
alert(tmp);
78+
var tmp2 = tmp.replace(/~~~~\{(.*)\}\n([\s\S]*?)~~~~\n/m, "<pre><code class=\"language-$1\">$2</code></pre>");
79+
80+
while(tmp!=tmp2)
81+
{
82+
83+
tmp = tmp2;
84+
85+
tmp2 = tmp.replace(/~~~~\{(.*)\}\n([\s\S]*?)~~~~\n/m, "<pre><code class=\"language-$1\">$2</code></pre>");
86+
}
87+
88+
$("#content").html(tmp);
89+
Prism.highlightAll();
90+
MathJax.Hub.Queue(["Typeset", MathJax.Hub, "html"]);
91+
}
7592
$(document).ready(function() {
7693
alert("hre");
94+
$("#md").on("keyup", function() {
95+
mdupdate();
96+
});
97+
mdupdate();
7798
});
7899
</script>
79100
</body>

0 commit comments

Comments
 (0)