Treat <details> and <summary> as block level.

<details> and <summary> elements should never
be wrapped in "<p></p>".

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
Thomas Hochstein 2020-04-22 17:24:00 +02:00
parent 71f6fb8fbb
commit 5078cf7782
2 changed files with 2 additions and 2 deletions

View file

@ -354,7 +354,7 @@ class Markdown implements MarkdownInterface {
$block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'.
'script|noscript|style|form|fieldset|iframe|math|svg|'.
'article|section|nav|aside|hgroup|header|footer|'.
'figure';
'figure|details|summary';
// Regular expression for the content of a block tag.
$nested_tags_level = 4;

View file

@ -345,7 +345,7 @@ class MarkdownExtra extends \Michelf\Markdown {
* Tags that are always treated as block tags
* @var string
*/
protected $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend|article|section|nav|aside|hgroup|header|footer|figcaption|figure';
protected $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend|article|section|nav|aside|hgroup|header|footer|figcaption|figure|details|summary';
/**
* Tags treated as block tags only if the opening tag is alone on its line