-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(HTMLParser): fix ghCodeBlocks being parsed inside code tags
When using html pre/code tags to wrap github's fenced code block syntax, showdown would parsed them instead of treating them like plain code. Closes #229
- Loading branch information
Showing
14 changed files
with
174 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,5 @@ | |
<li><p>A list item with code:</p> | ||
|
||
<pre><code>alert('Hello world!'); | ||
</code></pre> | ||
</li> | ||
</code></pre></li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
test/issues/#229.2.code-being-parsed-inside-HTML-code-tags.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<pre lang="no-highlight"><code> | ||
foo | ||
|
||
```javascript | ||
var s = "JavaScript syntax highlighting"; | ||
alert(s); | ||
``` | ||
|
||
bar | ||
</code></pre> | ||
|
||
<p>this is a long paragraph</p> | ||
|
||
<p>this is another long paragraph</p> | ||
|
||
<pre lang="no-highlight"><code>```javascript | ||
var s = "JavaScript syntax highlighting"; | ||
alert(s); | ||
``` | ||
|
||
```python | ||
s = "Python syntax highlighting" | ||
print s | ||
``` | ||
</code></pre> |
25 changes: 25 additions & 0 deletions
25
test/issues/#229.2.code-being-parsed-inside-HTML-code-tags.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<pre lang="no-highlight"><code> | ||
foo | ||
|
||
```javascript | ||
var s = "JavaScript syntax highlighting"; | ||
alert(s); | ||
``` | ||
|
||
bar | ||
</code></pre> | ||
|
||
this is a long paragraph | ||
|
||
this is another long paragraph | ||
|
||
<pre lang="no-highlight"><code>```javascript | ||
var s = "JavaScript syntax highlighting"; | ||
alert(s); | ||
``` | ||
|
||
```python | ||
s = "Python syntax highlighting" | ||
print s | ||
``` | ||
</code></pre> |
16 changes: 16 additions & 0 deletions
16
test/issues/#229.code-being-parsed-inside-HTML-code-tags.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<pre lang="no-highlight"><code> | ||
```javascript | ||
var s = "JavaScript syntax highlighting"; | ||
alert(s); | ||
``` | ||
|
||
```python | ||
s = "Python syntax highlighting" | ||
print s | ||
``` | ||
|
||
``` | ||
No language indicated, so no syntax highlighting. | ||
But let's throw in a <b>tag</b>. | ||
``` | ||
</code></pre> |
16 changes: 16 additions & 0 deletions
16
test/issues/#229.code-being-parsed-inside-HTML-code-tags.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<pre lang="no-highlight"><code> | ||
```javascript | ||
var s = "JavaScript syntax highlighting"; | ||
alert(s); | ||
``` | ||
|
||
```python | ||
s = "Python syntax highlighting" | ||
print s | ||
``` | ||
|
||
``` | ||
No language indicated, so no syntax highlighting. | ||
But let's throw in a <b>tag</b>. | ||
``` | ||
</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<ul> | ||
<li><p>a list containing a block of code</p> | ||
<li> | ||
<p>a list containing a block of code</p> | ||
|
||
<pre><code>10 PRINT HELLO INFINITE | ||
<pre><code>10 PRINT HELLO INFINITE | ||
20 GOTO 10 | ||
</code></pre> | ||
</li> | ||
</code></pre></li> | ||
</ul> |