aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--markdown/__init__.py3
-rw-r--r--tests/extensions-x-tables/tables.html124
2 files changed, 120 insertions, 7 deletions
diff --git a/markdown/__init__.py b/markdown/__init__.py
index 4c5f993..31ab29c 100644
--- a/markdown/__init__.py
+++ b/markdown/__init__.py
@@ -69,7 +69,8 @@ DEFAULT_OUTPUT_FORMAT = 'xhtml1' # xhtml or html4 output
HTML_REMOVED_TEXT = "[HTML_REMOVED]" # text used instead of HTML in safe mode
BLOCK_LEVEL_ELEMENTS = re.compile("p|div|h[1-6]|blockquote|pre|table|dl|ol|ul"
"|script|noscript|form|fieldset|iframe|math"
- "|ins|del|hr|hr/|style|li|dt|dd|tr")
+ "|ins|del|hr|hr/|style|li|dt|dd|thead|tbody"
+ "|tr|th|td")
DOC_TAG = "div" # Element used to wrap document - later removed
# Placeholders
diff --git a/tests/extensions-x-tables/tables.html b/tests/extensions-x-tables/tables.html
index 0549bdf..c931e6a 100644
--- a/tests/extensions-x-tables/tables.html
+++ b/tests/extensions-x-tables/tables.html
@@ -1,7 +1,119 @@
<h2>Table Tests</h2>
-<table><thead><tr><th>First Header</th><th>Second Header</th></tr></thead><tbody><tr><td>Content Cell</td><td>Content Cell</td></tr><tr><td>Content Cell</td><td>Content Cell</td></tr></tbody></table>
-<table><thead><tr><th>First Header</th><th>Second Header</th></tr></thead><tbody><tr><td>Content Cell</td><td>Content Cell</td></tr><tr><td>Content Cell</td><td>Content Cell</td></tr></tbody></table>
-<table><thead><tr><th>Item</th><th align="right">Value</th></tr></thead><tbody><tr><td>Computer</td><td align="right">$1600</td></tr><tr><td>Phone</td><td align="right">$12</td></tr><tr><td>Pipe</td><td align="right">$1</td></tr></tbody></table>
-<table><thead><tr><th>Function name</th><th>Description</th></tr></thead><tbody><tr><td><code>help()</code></td><td>Display the help window.</td></tr><tr><td><code>destroy()</code></td><td><strong>Destroy your computer!</strong></td></tr></tbody></table>
-<table><thead><tr><th align="left">foo</th><th align="center">bar</th><th align="right">baz</th></tr></thead><tbody><tr><td align="left" /><td align="center">Q</td><td align="right" /></tr><tr><td align="left">W</td><td align="center" /><td align="right">W</td></tr></tbody></table>
-<table><thead><tr><th>foo</th><th>bar</th><th>baz</th></tr></thead><tbody><tr><td /><td>Q</td><td /></tr><tr><td>W</td><td /><td>W</td></tr></tbody></table> \ No newline at end of file
+<table>
+<thead>
+<tr>
+<th>First Header</th>
+<th>Second Header</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Content Cell</td>
+<td>Content Cell</td>
+</tr>
+<tr>
+<td>Content Cell</td>
+<td>Content Cell</td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>First Header</th>
+<th>Second Header</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Content Cell</td>
+<td>Content Cell</td>
+</tr>
+<tr>
+<td>Content Cell</td>
+<td>Content Cell</td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Item</th>
+<th align="right">Value</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Computer</td>
+<td align="right">$1600</td>
+</tr>
+<tr>
+<td>Phone</td>
+<td align="right">$12</td>
+</tr>
+<tr>
+<td>Pipe</td>
+<td align="right">$1</td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Function name</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>help()</code></td>
+<td>Display the help window.</td>
+</tr>
+<tr>
+<td><code>destroy()</code></td>
+<td><strong>Destroy your computer!</strong></td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th align="left">foo</th>
+<th align="center">bar</th>
+<th align="right">baz</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left" />
+<td align="center">Q</td>
+<td align="right" />
+</tr>
+<tr>
+<td align="left">W</td>
+<td align="center" />
+<td align="right">W</td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>foo</th>
+<th>bar</th>
+<th>baz</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td />
+<td>Q</td>
+<td />
+</tr>
+<tr>
+<td>W</td>
+<td />
+<td>W</td>
+</tr>
+</tbody>
+</table> \ No newline at end of file