فهرست منبع

fix(subparsers/tables.js): fix parser order so that tables include all spanGamut elements

Estevão Soares dos Santos 10 سال پیش
والد
کامیت
5ec75c459b

+ 1 - 1
dist/showdown.js

@@ -458,7 +458,6 @@ showdown.Converter = function (converterOptions) {
        * @type {string[]}
        */
       parserOrder = [
-        'tables',
         'githubCodeBlocks',
         'hashHTMLBlocks',
         'stripLinkDefinitions',
@@ -912,6 +911,7 @@ 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('blockQuotes')(text, options, globals);

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/showdown.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/showdown.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/showdown.min.js.map


+ 0 - 1
src/converter.js

@@ -44,7 +44,6 @@ showdown.Converter = function (converterOptions) {
        * @type {string[]}
        */
       parserOrder = [
-        'tables',
         'githubCodeBlocks',
         'hashHTMLBlocks',
         'stripLinkDefinitions',

+ 1 - 0
src/subParsers/blockGamut.js

@@ -13,6 +13,7 @@ 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('blockQuotes')(text, options, globals);

+ 26 - 0
test/features/tables/with-span-elements.html

@@ -0,0 +1,26 @@
+<table>
+    <thead>
+    <tr>
+        <th>First Header</th>
+        <th>Second Header</th>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td><strong>bold</strong></td>
+        <td><img src="foo.jpg" alt="img" /></td>
+    </tr>
+    <tr>
+        <td><em>italic</em></td>
+        <td><a href="bla.html">link</a></td>
+    </tr>
+    <tr>
+        <td><code>some code</code></td>
+        <td><a href="www.google.com">google</a></td>
+    </tr>
+    <tr>
+        <td><a href="www.foo.com">www.foo.com</a></td>
+        <td>normal</td>
+    </tr>
+    </tbody>
+</table>

+ 9 - 0
test/features/tables/with-span-elements.md

@@ -0,0 +1,9 @@
+| First Header  | Second Header     |
+| ------------- | ----------------- |
+| **bold**      | ![img](foo.jpg)   |
+| _italic_      | [link](bla.html)  |
+| `some code`   | [google][1]       |
+| <www.foo.com> | normal            |
+
+
+  [1]: www.google.com

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است