Skip to content

Commit a7509ce

Browse files
committed
是
1 parent 4d7bc31 commit a7509ce

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎_includes/themes/twitter/post.html‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,15 @@ <h1>{{ page.title }} {% if page.tagline %}<small>{{page.tagline}}</small>{% endi
5454

5555
var tmp = $("#md").html();
5656
alert(tmp);
57-
//var tmp2 = tmp.replace(/<pre><code>\n\/\/(.*)\n([\s\S]*?)</code></pre>\n/m, "<pre><code class=\"language-$1\">$2</code></pre>");
57+
var reg=new RegExp(/<pre><code>\n?\/\/(.*)\n([\s\S]*?)<\/code><\/pre>\n/m);
58+
var tmp2 = tmp.replace(reg, "<pre><code class=\"language-$1\">$2</code></pre>");
5859
alert(tmp2);
5960
while(tmp!=tmp2)
6061
{
6162

6263
tmp = tmp2;
6364

64-
tmp2 = tmp.replace(/~~\{(.*)\}\n([\s\S]*?)~~\n/m, "<pre><code class=\"language-$1\">$2</code></pre>");
65+
tmp2 = tmp.replace(reg, "<pre><code class=\"language-$1\">$2</code></pre>");
6566
}
6667

6768
$("#md").html(tmp);

‎_posts/2014-05-23-md测试.md‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ $$f(x)=x^{x^x}$$
2626
$\sqrt[3]{1+\sqrt[4]{1+\sqrt[4]{1+\sqrt{x}}}}$
2727

2828
[Google](http://google.com)
29-
~~~{python}
30-
print 'hello world'
31-
~~~
32-
test `test`
33-
34-
3529

3630
//java
3731
public static void main(String[]args)
@@ -40,6 +34,15 @@ test `test`
4034
System.out.println("你好");
4135
}
4236

37+
~~~{python}
38+
print 'hello world'
39+
~~~
40+
test `test`
41+
42+
43+
44+
45+
4346

4447
---code---{java}
4548
public static void main(String[]args)

0 commit comments

Comments
 (0)