From a09e65c0e8d5444e292bc76ed460f5e8d25d9a93 Mon Sep 17 00:00:00 2001 From: Michel Fortin Date: Thu, 4 Oct 2012 09:57:45 -0400 Subject: [PATCH] Added HTML 5 elements to the block parser. --- PHP Markdown Readme.text | 7 +++++++ markdown.php | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/PHP Markdown Readme.text b/PHP Markdown Readme.text index 9052814a..e242ca22 100644 --- a/PHP Markdown Readme.text +++ b/PHP Markdown Readme.text @@ -200,6 +200,13 @@ expected; (3) the output PHP Markdown actually produced. Version History --------------- +Current: + +* The following HTML 5 elements are treated as block elements when at the + root of an HTML block: `article`, `section`, `nav`, `aside`, `hgroup`, + `header`, `footer`, and `figure`. `svg` too. + + 1.0.1o (8 Jan 2012): * Silenced a new warning introduced around PHP 5.3 complaining about diff --git a/markdown.php b/markdown.php index 67294cb3..4c5aaee6 100644 --- a/markdown.php +++ b/markdown.php @@ -382,7 +382,9 @@ function hashHTMLBlocks($text) { # $block_tags_a_re = 'ins|del'; $block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'. - 'script|noscript|form|fieldset|iframe|math'; + 'script|noscript|form|fieldset|iframe|math|svg|'. + 'article|section|nav|aside|hgroup|header|footer|' + 'figure'; # Regular expression for the content of a block tag. $nested_tags_level = 4;