mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix some tests
This commit is contained in:
parent
9dab0826c6
commit
2d593d91f3
|
@ -29,6 +29,8 @@ showdown.subParser('makehtml.encodeCode', function (text, options, globals) {
|
||||||
// Do the angle bracket song and dance:
|
// Do the angle bracket song and dance:
|
||||||
.replace(/</g, '<')
|
.replace(/</g, '<')
|
||||||
.replace(/>/g, '>')
|
.replace(/>/g, '>')
|
||||||
|
// encode "
|
||||||
|
.replace(/"/g, '"')
|
||||||
// Now, escape characters that are magic in Markdown:
|
// Now, escape characters that are magic in Markdown:
|
||||||
.replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback);
|
.replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback);
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<p>this is some text</p>
|
<p>this is some text</p>
|
||||||
<p><code>php function thisThing() { echo "some weird formatted code!"; } </code></p>
|
<p><code>php function thisThing() { echo "some weird formatted code!"; } </code></p>
|
||||||
<p>some other text</p>
|
<p>some other text</p>
|
||||||
|
|
|
@ -75,7 +75,7 @@ ___triple underscores___
|
||||||
<p>Which gives you a link like this:</p>
|
<p>Which gives you a link like this:</p>
|
||||||
<p>This is <a href="http://example.com/" title="Optional Title Here">an example</a> reference-style link.</p>
|
<p>This is <a href="http://example.com/" title="Optional Title Here">an example</a> reference-style link.</p>
|
||||||
<p>Elsewhere in the document, usually at the bottom of the file, you define your link label on a line by itself:</p>
|
<p>Elsewhere in the document, usually at the bottom of the file, you define your link label on a line by itself:</p>
|
||||||
<pre><code>[id]: http://example.com/ "Optional Title Here"
|
<pre><code>[id]: http://example.com/ "Optional Title Here"
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>Links can get pretty fancy, so if you want the long form version, visit the
|
<p>Links can get pretty fancy, so if you want the long form version, visit the
|
||||||
official <a href="http://daringfireball.net/projects/markdown/">Markdown</a> docs.</p>
|
official <a href="http://daringfireball.net/projects/markdown/">Markdown</a> docs.</p>
|
||||||
|
@ -84,7 +84,7 @@ ___triple underscores___
|
||||||
<p><img src="http://www.addictedtoibiza.com/wp-content/uploads/2012/12/example.png" alt="Alt text" /></p>
|
<p><img src="http://www.addictedtoibiza.com/wp-content/uploads/2012/12/example.png" alt="Alt text" /></p>
|
||||||
<pre><code>![Alt text](http://www.addictedtoibiza.com/wp-content/uploads/2012/12/example.png)
|
<pre><code>![Alt text](http://www.addictedtoibiza.com/wp-content/uploads/2012/12/example.png)
|
||||||
|
|
||||||
![Alt text](http://www.addictedtoibiza.com/wp-content/uploads/2012/12/example.png "Optional title")
|
![Alt text](http://www.addictedtoibiza.com/wp-content/uploads/2012/12/example.png "Optional title")
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<hr />
|
<hr />
|
||||||
<h1 id="blockelements">Block Elements</h1>
|
<h1 id="blockelements">Block Elements</h1>
|
||||||
|
@ -157,7 +157,7 @@ This is a second.
|
||||||
<li>This is the second list item.</li>
|
<li>This is the second list item.</li>
|
||||||
</ol>
|
</ol>
|
||||||
<p>Here's some example code:</p>
|
<p>Here's some example code:</p>
|
||||||
<pre><code>return shell_exec("echo $input | $markdown_script");
|
<pre><code>return shell_exec("echo $input | $markdown_script");
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<pre><code>> ## This is a header.
|
<pre><code>> ## This is a header.
|
||||||
|
@ -167,7 +167,7 @@ This is a second.
|
||||||
>
|
>
|
||||||
> Here's some example code:
|
> Here's some example code:
|
||||||
>
|
>
|
||||||
> return shell_exec("echo $input | $markdown_script");
|
> return shell_exec("echo $input | $markdown_script");
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h2 id="lists">Lists</h2>
|
<h2 id="lists">Lists</h2>
|
||||||
<p>Markdown supports ordered (numbered) and unordered (bulleted) lists. List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab.</p>
|
<p>Markdown supports ordered (numbered) and unordered (bulleted) lists. List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab.</p>
|
||||||
|
@ -331,7 +331,7 @@ Pipe | $1 | eleven
|
||||||
<p>You can also highlight snippets of text (Markdown uses the excellent <a href="http://pygments.org/">Pygments</a> library) to allow you to use code highlighting Here's an example of some Python code:</p>
|
<p>You can also highlight snippets of text (Markdown uses the excellent <a href="http://pygments.org/">Pygments</a> library) to allow you to use code highlighting Here's an example of some Python code:</p>
|
||||||
<pre><code>#!python
|
<pre><code>#!python
|
||||||
#
|
#
|
||||||
def wiki_rocks(text): formatter = lambda t: "funky"+t return formatter(text)
|
def wiki_rocks(text): formatter = lambda t: "funky"+t return formatter(text)
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>To do this, do not indent the block. Start the block with <code>```</code> three ticks. Then, provide the comment with the type of syntax you are using. There is a <a href="http://pygments.org/docs/lexers/">the vast library of Pygment lexers</a>. Markdown accepts the 'short name' or the 'mimetype' of anything in there.</p>
|
<p>To do this, do not indent the block. Start the block with <code>```</code> three ticks. Then, provide the comment with the type of syntax you are using. There is a <a href="http://pygments.org/docs/lexers/">the vast library of Pygment lexers</a>. Markdown accepts the 'short name' or the 'mimetype' of anything in there.</p>
|
||||||
<p>You can also use a fence style for code.</p>
|
<p>You can also use a fence style for code.</p>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
foo
|
foo
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var s = "JavaScript syntax highlighting";
|
var s = "JavaScript syntax highlighting";
|
||||||
alert(s);
|
alert(s);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -11,12 +11,12 @@ bar
|
||||||
<p>this is a long paragraph</p>
|
<p>this is a long paragraph</p>
|
||||||
<p>this is another long paragraph</p>
|
<p>this is another long paragraph</p>
|
||||||
<pre lang="no-highlight"><code>```javascript
|
<pre lang="no-highlight"><code>```javascript
|
||||||
var s = "JavaScript syntax highlighting";
|
var s = "JavaScript syntax highlighting";
|
||||||
alert(s);
|
alert(s);
|
||||||
```
|
```
|
||||||
|
|
||||||
```python
|
```python
|
||||||
s = "Python syntax highlighting"
|
s = "Python syntax highlighting"
|
||||||
print s
|
print s
|
||||||
```
|
```
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<pre lang="no-highlight"><code>
|
<pre lang="no-highlight"><code>
|
||||||
```javascript
|
```javascript
|
||||||
var s = "JavaScript syntax highlighting";
|
var s = "JavaScript syntax highlighting";
|
||||||
alert(s);
|
alert(s);
|
||||||
```
|
```
|
||||||
|
|
||||||
```python
|
```python
|
||||||
s = "Python syntax highlighting"
|
s = "Python syntax highlighting"
|
||||||
print s
|
print s
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
for (int i = 0; i < 10 && true; i++) {
|
for (int i = 0; i < 10 && true; i++) {
|
||||||
|
|
||||||
System.out.println("Hello World");
|
System.out.println("Hello World");
|
||||||
}
|
}
|
||||||
|
|
||||||
// stuff here is affected as well <>&&%
|
// stuff here is affected as well <>&&%
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
for (int i = 0; i < 10 && true; i++) {
|
for (int i = 0; i < 10 && true; i++) {
|
||||||
|
|
||||||
System.out.println("Hello World");
|
System.out.println("Hello World");
|
||||||
}
|
}
|
||||||
|
|
||||||
// stuff here is affected as well <>&&%
|
// stuff here is affected as well <>&&%
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<pre><code class="json language-json">{
|
<pre><code class="json language-json">{
|
||||||
"custom": true
|
"custom": true
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<pre><code class="json language-json">{
|
<pre><code class="json language-json">{
|
||||||
"custom": false
|
"custom": false
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
|
@ -5,6 +5,6 @@
|
||||||
<li>This is the second list item.</li>
|
<li>This is the second list item.</li>
|
||||||
</ol>
|
</ol>
|
||||||
<p>Here's some example code:</p>
|
<p>Here's some example code:</p>
|
||||||
<pre><code>return shell_exec("echo $input | $markdown_script");
|
<pre><code>return shell_exec("echo $input | $markdown_script");
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>list item 1</p>
|
<li><p>list item 1</p>
|
||||||
<pre><code class="html language-html"><a href="www.google.com">google</a>
|
<pre><code class="html language-html"><a href="www.google.com">google</a>
|
||||||
<div>
|
<div>
|
||||||
<div>some div</div>
|
<div>some div</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<p><code>some **code** yeah</code></p>
|
<p><code>some **code** yeah</code></p>
|
||||||
<p>some <code>inline **code** block</code></p>
|
<p>some <code>inline **code** block</code></p>
|
||||||
<p><code>some inline **code**</code> block</p>
|
<p><code>some inline **code**</code> block</p>
|
||||||
<p>yo dawg <code start="true">some <code start="false">code</code> inception</code></p>
|
<p>yo dawg <code start="true">some <code start="false">code</code> inception</code></p>
|
||||||
<div>some **div** yeah</div>
|
<div>some **div** yeah</div>
|
|
@ -29,10 +29,6 @@ describe('makeHtml() commonmark testsuite', function () {
|
||||||
//case 'Raw HTML_619': // breaks prettifier so the test fails
|
//case 'Raw HTML_619': // breaks prettifier so the test fails
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 'Setext headings_91': //it's failing because the testcase converts " to " even though it's not supposed to
|
|
||||||
testsuite[section][i].expected = testsuite[section][i].expected.replace(/"/g, '"')
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'Fenced code blocks_142': // we use different classes to mark languages in fenced code blocks
|
case 'Fenced code blocks_142': // we use different classes to mark languages in fenced code blocks
|
||||||
case 'Fenced code blocks_143': // we use different classes to mark languages in fenced code blocks
|
case 'Fenced code blocks_143': // we use different classes to mark languages in fenced code blocks
|
||||||
testsuite[section][i].expected = testsuite[section][i].expected.replace('language-ruby', 'ruby language-ruby');
|
testsuite[section][i].expected = testsuite[section][i].expected.replace('language-ruby', 'ruby language-ruby');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user