diff --git a/src/subParsers/makehtml/encodeCode.js b/src/subParsers/makehtml/encodeCode.js index 019e5f4..ff58545 100644 --- a/src/subParsers/makehtml/encodeCode.js +++ b/src/subParsers/makehtml/encodeCode.js @@ -29,6 +29,8 @@ showdown.subParser('makehtml.encodeCode', function (text, options, globals) { // Do the angle bracket song and dance: .replace(//g, '>') + // encode " + .replace(/"/g, '"') // Now, escape characters that are magic in Markdown: .replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback); diff --git a/test/functional/makehtml/cases/features/disable-gh-codeblocks.html b/test/functional/makehtml/cases/features/disable-gh-codeblocks.html index a252d67..448b385 100644 --- a/test/functional/makehtml/cases/features/disable-gh-codeblocks.html +++ b/test/functional/makehtml/cases/features/disable-gh-codeblocks.html @@ -1,3 +1,3 @@
this is some text
-php function thisThing() { echo "some weird formatted code!"; }
php function thisThing() { echo "some weird formatted code!"; }
some other text
diff --git a/test/functional/makehtml/cases/features/underline/fulltext.html b/test/functional/makehtml/cases/features/underline/fulltext.html index 646fd3e..293c757 100644 --- a/test/functional/makehtml/cases/features/underline/fulltext.html +++ b/test/functional/makehtml/cases/features/underline/fulltext.html @@ -75,7 +75,7 @@ ___triple underscores___Which gives you a link like this:
This is an example reference-style link.
Elsewhere in the document, usually at the bottom of the file, you define your link label on a line by itself:
-[id]: http://example.com/ "Optional Title Here"
+[id]: http://example.com/ "Optional Title Here"
Links can get pretty fancy, so if you want the long form version, visit the
official Markdown docs.
@@ -84,7 +84,7 @@ ___triple underscores___
![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")
Block Elements
@@ -157,7 +157,7 @@ This is a second.
This is the second list item.
Here's some example code:
- return shell_exec("echo $input | $markdown_script");
+ return shell_exec("echo $input | $markdown_script");
> ## This is a header.
@@ -167,7 +167,7 @@ This is a second.
>
> Here's some example code:
>
-> return shell_exec("echo $input | $markdown_script");
+> return shell_exec("echo $input | $markdown_script");
Lists
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.
@@ -331,7 +331,7 @@ Pipe | $1 | eleven
You can also highlight snippets of text (Markdown uses the excellent Pygments library) to allow you to use code highlighting Here's an example of some Python 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)
To do this, do not indent the block. Start the block with ```
three ticks. Then, provide the comment with the type of syntax you are using. There is a the vast library of Pygment lexers. Markdown accepts the 'short name' or the 'mimetype' of anything in there.
You can also use a fence style for code.
diff --git a/test/functional/makehtml/cases/issues/#229.2.code-being-parsed-inside-HTML-code-tags.html b/test/functional/makehtml/cases/issues/#229.2.code-being-parsed-inside-HTML-code-tags.html
index 53c8243..e34f543 100644
--- a/test/functional/makehtml/cases/issues/#229.2.code-being-parsed-inside-HTML-code-tags.html
+++ b/test/functional/makehtml/cases/issues/#229.2.code-being-parsed-inside-HTML-code-tags.html
@@ -2,7 +2,7 @@
foo
```javascript
-var s = "JavaScript syntax highlighting";
+var s = "JavaScript syntax highlighting";
alert(s);
```
@@ -11,12 +11,12 @@ bar
this is a long paragraph
this is another long paragraph
```javascript
-var s = "JavaScript syntax highlighting";
+var s = "JavaScript syntax highlighting";
alert(s);
```
```python
-s = "Python syntax highlighting"
+s = "Python syntax highlighting"
print s
```
diff --git a/test/functional/makehtml/cases/issues/#229.code-being-parsed-inside-HTML-code-tags.html b/test/functional/makehtml/cases/issues/#229.code-being-parsed-inside-HTML-code-tags.html
index deba3d4..a0b9f9e 100644
--- a/test/functional/makehtml/cases/issues/#229.code-being-parsed-inside-HTML-code-tags.html
+++ b/test/functional/makehtml/cases/issues/#229.code-being-parsed-inside-HTML-code-tags.html
@@ -1,11 +1,11 @@
```javascript
-var s = "JavaScript syntax highlighting";
+var s = "JavaScript syntax highlighting";
alert(s);
```
```python
-s = "Python syntax highlighting"
+s = "Python syntax highlighting"
print s
```
diff --git a/test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code-2.html b/test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code-2.html
index 032a50b..9febb5a 100644
--- a/test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code-2.html
+++ b/test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code-2.html
@@ -2,7 +2,7 @@
for (int i = 0; i < 10 && true; i++) {
- System.out.println("Hello World");
+ System.out.println("Hello World");
}
// stuff here is affected as well <>&&%
diff --git a/test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code.html b/test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code.html
index 95f5bb5..c029d2d 100644
--- a/test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code.html
+++ b/test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code.html
@@ -4,7 +4,7 @@
for (int i = 0; i < 10 && true; i++) {
- System.out.println("Hello World");
+ System.out.println("Hello World");
}
// stuff here is affected as well <>&&%
diff --git a/test/functional/makehtml/cases/issues/#856.gfm-codeblock-with-language-with-spaces.html b/test/functional/makehtml/cases/issues/#856.gfm-codeblock-with-language-with-spaces.html
index 39b5e7b..31cfc92 100644
--- a/test/functional/makehtml/cases/issues/#856.gfm-codeblock-with-language-with-spaces.html
+++ b/test/functional/makehtml/cases/issues/#856.gfm-codeblock-with-language-with-spaces.html
@@ -1,8 +1,8 @@
{
- "custom": true
+ "custom": true
}
{
- "custom": false
+ "custom": false
}
diff --git a/test/functional/makehtml/cases/standard/blockquote-nested-markdown.html b/test/functional/makehtml/cases/standard/blockquote-nested-markdown.html
index a73ca6e..afbf06f 100644
--- a/test/functional/makehtml/cases/standard/blockquote-nested-markdown.html
+++ b/test/functional/makehtml/cases/standard/blockquote-nested-markdown.html
@@ -5,6 +5,6 @@
This is the second list item.
Here's some example code:
- return shell_exec("echo $input | $markdown_script");
+ return shell_exec("echo $input | $markdown_script");
diff --git a/test/functional/makehtml/cases/standard/html-inside-listed-code.html b/test/functional/makehtml/cases/standard/html-inside-listed-code.html
index 31001d9..35394fc 100644
--- a/test/functional/makehtml/cases/standard/html-inside-listed-code.html
+++ b/test/functional/makehtml/cases/standard/html-inside-listed-code.html
@@ -1,6 +1,6 @@
list item 1
-<a href="www.google.com">google</a>
+<a href="www.google.com">google</a>
<div>
<div>some div</div>
</div>
diff --git a/test/functional/makehtml/cases/standard/literal-html-tags.html b/test/functional/makehtml/cases/standard/literal-html-tags.html
index c3ed5a7..b407bf3 100644
--- a/test/functional/makehtml/cases/standard/literal-html-tags.html
+++ b/test/functional/makehtml/cases/standard/literal-html-tags.html
@@ -1,5 +1,5 @@
some **code** yeah
some inline **code** block
some inline **code**
block
-yo dawg some <code start="false">code</code> inception
+yo dawg some <code start="false">code</code> inception
some **div** yeah
\ No newline at end of file
diff --git a/test/functional/makehtml/extra.testsuite.commonmark.js b/test/functional/makehtml/extra.testsuite.commonmark.js
index f90139c..59060e4 100644
--- a/test/functional/makehtml/extra.testsuite.commonmark.js
+++ b/test/functional/makehtml/extra.testsuite.commonmark.js
@@ -29,10 +29,6 @@ describe('makeHtml() commonmark testsuite', function () {
//case 'Raw HTML_619': // breaks prettifier so the test fails
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_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');