aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHorst Gutmann <zerok@zerokspot.com>2011-05-22 10:39:51 +0200
committerHorst Gutmann <zerok@zerokspot.com>2011-05-22 10:39:51 +0200
commitbe0a34d705eecd6ed13c67558f17626597ba6603 (patch)
treee3298452c02ec4c6d3e3001a495d8900816c4213
parentd43c3deeb389ff8abd74b0605939b3477eaf6a9c (diff)
downloadmarkdown-be0a34d705eecd6ed13c67558f17626597ba6603.tar.gz
markdown-be0a34d705eecd6ed13c67558f17626597ba6603.tar.bz2
markdown-be0a34d705eecd6ed13c67558f17626597ba6603.zip
Added new HTML5 block elements to known block level elements
-rw-r--r--markdown/util.py4
-rw-r--r--tests/misc/block_html5.html16
-rw-r--r--tests/misc/block_html5.txt14
3 files changed, 33 insertions, 1 deletions
diff --git a/markdown/util.py b/markdown/util.py
index 8e950b9..1b55de4 100644
--- a/markdown/util.py
+++ b/markdown/util.py
@@ -18,7 +18,9 @@ Constants you might want to modify
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|thead|tbody"
- "|tr|th|td")
+ "|tr|th|td|section|footer|header|group|figure"
+ "|figcaption|aside|article|canvas|output"
+ "|progress|video")
# Placeholders
STX = u'\u0002' # Use STX ("Start of text") for start-of-placeholder
ETX = u'\u0003' # Use ETX ("End of text") for end-of-placeholder
diff --git a/tests/misc/block_html5.html b/tests/misc/block_html5.html
new file mode 100644
index 0000000..b7a2fd3
--- /dev/null
+++ b/tests/misc/block_html5.html
@@ -0,0 +1,16 @@
+<section>
+ <header>
+ <hgroup>
+ <h1>Hello :-)</h1>
+ </hgroup>
+ </header>
+ <figure>
+ <img src="image.png" alt="" />
+ <figcaption>Caption</figcaption>
+ </figure>
+ <footer>
+ <p>Some footer</p>
+ </footer>
+</section>
+
+<figure></figure> \ No newline at end of file
diff --git a/tests/misc/block_html5.txt b/tests/misc/block_html5.txt
new file mode 100644
index 0000000..2b24cad
--- /dev/null
+++ b/tests/misc/block_html5.txt
@@ -0,0 +1,14 @@
+<section>
+ <header>
+ <hgroup>
+ <h1>Hello :-)</h1>
+ </hgroup>
+ </header>
+ <figure>
+ <img src="image.png" alt="" />
+ <figcaption>Caption</figcaption>
+ </figure>
+ <footer>
+ <p>Some footer</p>
+ </footer>
+</section><figure></figure>