Skip to content

Don't put <p> around summary tag inside details with markdown flag set? #1079

Description

@fiendish

The summary tag is a special tag inside details that I think should be ignored when processing internal markdown.

from markdown import markdown
from pprint import pprint

a = """
<details markdown="1">
<summary><b>Click to expand table</b></summary>

| Entity                              |   Count |
|:------------------------------------|--------:|
| Thing 1                      |      16 |
| Thing 2                      |       9 |

</details>
"""

pprint(markdown(a, extensions=["extra"]))
' <details>\n'
 '<p><summary><b>Click to expand table</b></summary></p>\n'
 '<table>\n'
 '<thead>\n'
 '<tr>\n'
 '<th align="left">Entity</th>\n'
 '<th align="right">Count</th>\n'
 '</tr>\n'
 '</thead>\n'
 '<tbody>\n'
 '<tr>\n'
 '<td align="left">Thing 1</td>\n'
 '<td align="right">16</td>\n'
 '</tr>\n'
 '<tr>\n'
 '<td align="left">Thing 2</td>\n'
 '<td align="right">9</td>\n'
 '</tr>\n'
 '</tbody>\n'
 '</table>\n'
 '</details>'

Note here that there are <p></p> around the summary, but IMO there should not be.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report.confirmedConfirmed bug report or approved feature request.coreRelated to the core parser code.extensionRelated to one or more of the included extensions.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions