Bläddra i källkod

fix(tables): fix md tables being parsed inside indented code blocks.

Closes #193
Estevão Soares dos Santos 10 år sedan
förälder
incheckning
50256233eb

+ 2 - 2
dist/showdown.js

@@ -1,4 +1,4 @@
-;/*! showdown 25-08-2015 */
+;/*! showdown 27-08-2015 */
 (function(){
 /**
  * Created by Tivie on 13-07-2015.
@@ -1035,9 +1035,9 @@ showdown.subParser('blockGamut', function (text, options, globals) {
   text = text.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm, key);
   text = text.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm, key);
 
-  text = showdown.subParser('tables')(text, options, globals);
   text = showdown.subParser('lists')(text, options, globals);
   text = showdown.subParser('codeBlocks')(text, options, globals);
+  text = showdown.subParser('tables')(text, options, globals);
 
   // We already ran _HashHTMLBlocks() before, in Markdown(), but that
   // was to escape raw HTML in the original Markdown source. This time,

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/showdown.js.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/showdown.min.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/showdown.min.js.map


+ 1 - 1
src/subParsers/blockGamut.js

@@ -16,9 +16,9 @@ showdown.subParser('blockGamut', function (text, options, globals) {
   text = text.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm, key);
   text = text.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm, key);
 
-  text = showdown.subParser('tables')(text, options, globals);
   text = showdown.subParser('lists')(text, options, globals);
   text = showdown.subParser('codeBlocks')(text, options, globals);
+  text = showdown.subParser('tables')(text, options, globals);
 
   // We already ran _HashHTMLBlocks() before, in Markdown(), but that
   // was to escape raw HTML in the original Markdown source. This time,

+ 8 - 0
test/features/tables/table-inside-codeblock.html

@@ -0,0 +1,8 @@
+<p>some text</p>
+
+<pre><code>| Tables        | Are           | Cool  |
+| ------------- |:-------------:| -----:|
+| **col 3 is**  | right-aligned | $1600 |
+| col 2 is      | *centered*    |   $12 |
+| zebra stripes | ~~are neat~~  |    $1 |
+</code></pre>

+ 8 - 0
test/features/tables/table-inside-codeblock.md

@@ -0,0 +1,8 @@
+some text
+
+
+    | Tables        | Are           | Cool  |
+    | ------------- |:-------------:| -----:|
+    | **col 3 is**  | right-aligned | $1600 |
+    | col 2 is      | *centered*    |   $12 |
+    | zebra stripes | ~~are neat~~  |    $1 |

Vissa filer visades inte eftersom för många filer har ändrats