diff options
| author | Waylan Limberg <waylan.limberg@icloud.com> | 2020-09-22 10:42:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-22 10:42:17 -0400 |
| commit | b701c34ebd7b2d0eb319517b9a275ddf0c89608d (patch) | |
| tree | b79839201a337d38276f345595947b0a15a7567b /tests/basic | |
| parent | 90e750b1f4fa8d150d7b5a4709858c786f2794dd (diff) | |
| download | python-markdown-b701c34ebd7b2d0eb319517b9a275ddf0c89608d.tar.gz | |
Refactor HTML Parser (#803)
The HTML parser has been completely replaced. The new HTML parser is built on Python's html.parser.HTMLParser, which alleviates various bugs and simplifies maintenance of the code.
The md_in_html extension has been rebuilt on the new HTML Parser, which drastically simplifies it. Note that raw HTML elements with a markdown attribute defined are now converted to ElementTree Elements and are rendered by the serializer. Various bugs have been fixed.
Link reference parsing, abbreviation reference parsing and footnote reference parsing has all been moved from preprocessors to blockprocessors, which allows them to be nested within other block level elements. Specifically, this change was necessary to maintain the current behavior in the rebuilt md_in_html extension. A few random edge-case bugs (see the included tests) were resolved in the process.
Closes #595, closes #780, closes #830 and closes #1012.
Diffstat (limited to 'tests/basic')
| -rw-r--r-- | tests/basic/inline-html-advanced.html | 12 | ||||
| -rw-r--r-- | tests/basic/inline-html-advanced.txt | 14 | ||||
| -rw-r--r-- | tests/basic/inline-html-comments.html | 11 | ||||
| -rw-r--r-- | tests/basic/inline-html-comments.txt | 13 | ||||
| -rw-r--r-- | tests/basic/inline-html-simple.html | 61 | ||||
| -rw-r--r-- | tests/basic/inline-html-simple.txt | 72 |
6 files changed, 0 insertions, 183 deletions
diff --git a/tests/basic/inline-html-advanced.html b/tests/basic/inline-html-advanced.html deleted file mode 100644 index af1dec1..0000000 --- a/tests/basic/inline-html-advanced.html +++ /dev/null @@ -1,12 +0,0 @@ -<p>Simple block on one line:</p> -<div>foo</div> - -<p>And nested without indentation:</p> -<div> -<div> -<div> -foo -</div> -</div> -<div>bar</div> -</div>
\ No newline at end of file diff --git a/tests/basic/inline-html-advanced.txt b/tests/basic/inline-html-advanced.txt deleted file mode 100644 index 9d71ddc..0000000 --- a/tests/basic/inline-html-advanced.txt +++ /dev/null @@ -1,14 +0,0 @@ -Simple block on one line: - -<div>foo</div> - -And nested without indentation: - -<div> -<div> -<div> -foo -</div> -</div> -<div>bar</div> -</div> diff --git a/tests/basic/inline-html-comments.html b/tests/basic/inline-html-comments.html deleted file mode 100644 index 0d4cad9..0000000 --- a/tests/basic/inline-html-comments.html +++ /dev/null @@ -1,11 +0,0 @@ -<p>Paragraph one.</p> -<!-- This is a simple comment --> - -<!-- - This is another comment. ---> - -<p>Paragraph two.</p> -<!-- one comment block -- -- with two comments --> - -<p>The end.</p>
\ No newline at end of file diff --git a/tests/basic/inline-html-comments.txt b/tests/basic/inline-html-comments.txt deleted file mode 100644 index 41d830d..0000000 --- a/tests/basic/inline-html-comments.txt +++ /dev/null @@ -1,13 +0,0 @@ -Paragraph one. - -<!-- This is a simple comment --> - -<!-- - This is another comment. ---> - -Paragraph two. - -<!-- one comment block -- -- with two comments --> - -The end. diff --git a/tests/basic/inline-html-simple.html b/tests/basic/inline-html-simple.html deleted file mode 100644 index 0f2633c..0000000 --- a/tests/basic/inline-html-simple.html +++ /dev/null @@ -1,61 +0,0 @@ -<p>Here's a simple block:</p> -<div> - foo -</div> - -<p>This should be a code block, though:</p> -<pre><code><div> - foo -</div> -</code></pre> -<p>As should this:</p> -<pre><code><div>foo</div> -</code></pre> -<p>Now, nested:</p> -<div> - <div> - <div> - foo - </div> - </div> -</div> - -<p>This should just be an HTML comment:</p> -<!-- Comment --> - -<p>Multiline:</p> -<!-- -Blah -Blah ---> - -<p>Code block:</p> -<pre><code><!-- Comment --> -</code></pre> -<p>Just plain comment, with trailing spaces on the line:</p> -<!-- foo --> - -<p>Code:</p> -<pre><code><hr /> -</code></pre> -<p>Hr's:</p> -<hr> - -<hr/> - -<hr /> - -<hr> - -<hr/> - -<hr /> - -<hr class="foo" id="bar" /> - -<hr class="foo" id="bar"/> - -<hr class="foo" id="bar" > - -<p><some <a href="http://example.com">weird</a> stuff></p> -<p><some>> <<unbalanced>> <<brackets></p>
\ No newline at end of file diff --git a/tests/basic/inline-html-simple.txt b/tests/basic/inline-html-simple.txt deleted file mode 100644 index 359aca4..0000000 --- a/tests/basic/inline-html-simple.txt +++ /dev/null @@ -1,72 +0,0 @@ -Here's a simple block: - -<div> - foo -</div> - -This should be a code block, though: - - <div> - foo - </div> - -As should this: - - <div>foo</div> - -Now, nested: - -<div> - <div> - <div> - foo - </div> - </div> -</div> - -This should just be an HTML comment: - -<!-- Comment --> - -Multiline: - -<!-- -Blah -Blah ---> - -Code block: - - <!-- Comment --> - -Just plain comment, with trailing spaces on the line: - -<!-- foo --> - -Code: - - <hr /> - -Hr's: - -<hr> - -<hr/> - -<hr /> - -<hr> - -<hr/> - -<hr /> - -<hr class="foo" id="bar" /> - -<hr class="foo" id="bar"/> - -<hr class="foo" id="bar" > - -<some [weird](http://example.com) stuff> - -<some>> <<unbalanced>> <<brackets>
\ No newline at end of file |
