Explorar el Código

Merge pull request #149 from showdownjs/revert-140-block-elements

Revert "Add missing block elements"
Estevão Soares dos Santos hace 10 años
padre
commit
9792ca9008
Se han modificado 3 ficheros con 5 adiciones y 111 borrados
  1. 1 1
      src/showdown.js
  2. 3 56
      test/cases/html5-strutural-tags.html
  3. 1 54
      test/cases/html5-strutural-tags.md

+ 1 - 1
src/showdown.js

@@ -375,7 +375,7 @@ Showdown.converter = function (converter_options) {
          )						// attacklab: there are sentinel newlines at end of document
          /gm,function(){...}};
          */
-        text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|style|section|header|footer|nav|article|aside|address|audio|canvas|figure|hgroup|output|video)\b[^\r]*?<\/\2>[ \t]*(?=\n+)\n)/gm,hashElement);
+        text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|style|section|header|footer|nav|article|aside)\b[^\r]*?<\/\2>[ \t]*(?=\n+)\n)/gm, hashElement);
 
         // Special case just for <hr />. It was easier to make a special case than
         // to make the other regex more complicated.

+ 3 - 56
test/cases/html5-strutural-tags.html

@@ -14,63 +14,10 @@
 <aside>ignore me</aside>
 
 <article>read
-    me</article>
+me</article>
 
 <aside>
-    ignore me
+ignore me
 </aside>
 
-<p>the end</p>
-
-<table class="test">
-    <tr>
-        <td>Foo</td>
-    </tr>
-    <tr>
-        <td>Bar</td>
-    </tr>
-</table>
-
-<table class="test">
-    <thead>
-    <tr>
-        <td>Foo</td>
-    </tr>
-    </thead>
-    <tr>
-        <td>Bar</td>
-    </tr>
-    <tfoot>
-    <tr>
-        <td>Bar</td>
-    </tr>
-    </tfoot>
-</table>
-
-<audio class="podcastplayer" controls>
-    <source src="foobar.mp3" type="audio/mp3" preload="none"></source>
-    <source src="foobar.off" type="audio/ogg" preload="none"></source>
-</audio>
-
-<video src="foo.ogg">
-    <track kind="subtitles" src="foo.en.vtt" srclang="en" label="English">
-    <track kind="subtitles" src="foo.sv.vtt" srclang="sv" label="Svenska">
-</video>
-
-<address>My street</address>
-
-<canvas id="canvas" width="300" height="300">
-    Sorry, your browser doesn't support the &lt;canvas&gt; element.
-</canvas>
-
-<figure>
-    <img src="mypic.png" alt="An awesome picture">
-    <figcaption>Caption for the awesome picture</figcaption>
-</figure>
-
-<hgroup>
-    <h1>Main title</h1>
-    <h2>Secondary title</h2>
-</hgroup>
-
-<output name="result"></output>
+<p>the end</p>

+ 1 - 54
test/cases/html5-strutural-tags.md

@@ -13,57 +13,4 @@ me</article>
 ignore me
 </aside>
 
-the end
-
-<table class="test">
-    <tr>
-        <td>Foo</td>
-    </tr>
-    <tr>
-        <td>Bar</td>
-    </tr>
-</table>
-
-<table class="test">
-    <thead>
-        <tr>
-            <td>Foo</td>
-        </tr>
-    </thead>
-    <tr>
-        <td>Bar</td>
-    </tr>
-    <tfoot>
-        <tr>
-            <td>Bar</td>
-        </tr>
-    </tfoot>
-</table>
-
-<audio class="podcastplayer" controls>
-    <source src="foobar.mp3" type="audio/mp3" preload="none"></source>
-    <source src="foobar.off" type="audio/ogg" preload="none"></source>
-</audio>
-
-<video src="foo.ogg">
-    <track kind="subtitles" src="foo.en.vtt" srclang="en" label="English">
-    <track kind="subtitles" src="foo.sv.vtt" srclang="sv" label="Svenska">
-</video>
-
-<address>My street</address>
-
-<canvas id="canvas" width="300" height="300">
-    Sorry, your browser doesn't support the &lt;canvas&gt; element.
-</canvas>
-
-<figure>
-    <img src="mypic.png" alt="An awesome picture">
-    <figcaption>Caption for the awesome picture</figcaption>
-</figure>
-
-<hgroup>
-  <h1>Main title</h1>
-  <h2>Secondary title</h2>
-</hgroup>
-
-<output name="result"></output>
+the end