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

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

See michelf/php-markdown#329.

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
Thomas Hochstein 2020-04-22 17:36:58 +02:00
parent 7d409eb828
commit 0e66b5cc0e
6 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,9 @@
Version 1.29:
=============
Changes by Thomas Hochstein <thh@inter.net>
- Treat <details> and <summary> as block level.
Version 1.28:
=============
Changes by Thomas Hochstein <thh@inter.net>

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

@ -299,7 +299,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

View file

@ -389,7 +389,7 @@ class Markdown_Parser {
$block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'.
'script|noscript|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

@ -421,7 +421,7 @@ class Markdown_Parser {
$block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'.
'script|noscript|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

@ -31,7 +31,7 @@ class serendipity_event_markdown extends serendipity_event
'smarty' => '2.6.7',
'php' => '5.3.0'
));
$propbag->add('version', '1.28');
$propbag->add('version', '1.29');
$propbag->add('cachable_events', array('frontend_display' => true));
$propbag->add('event_hooks', array(
'frontend_display' => true,