Merge pull request #329 from th-h/lib

Treat <details> and <summary> as block level.
This commit is contained in:
Michel Fortin 2020-04-22 13:02:37 -04:00 committed by GitHub
commit 6975244af2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 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

View file

@ -14,6 +14,13 @@
<hr class="foo"
id="bar" >
<p>Details and Summary:</p>
<details>
<summary>Some details</summary>
<p>More info about the details.</p>
</details>
<p>Regression:</p>
<pre>

View file

@ -14,6 +14,13 @@ Hr's:
<hr class="foo"
id="bar" >
Details and Summary:
<details>
<summary>Some details</summary>
<p>More info about the details.</p>
</details>
Regression:
<pre>