Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<p> elements wrapped around <summary> elements producing invalid html5 (2.9.2.1) #6385

Closed
poppadum opened this issue May 20, 2020 · 2 comments

Comments

@poppadum
Copy link

When converting the following markdown to html:

<details>
<summary>Show me:</summary>
details para 1

details para 2
</details>

produces:

<details>
<p><summary>Show me:</summary>details para 1</p>
details para 2
</details>

which is not valid html5. The <summary> element must be the first child of a <details> element (see the html5 spec)

I would expect the output to be

<details>
<summary>Show me:</summary>
<p>details para 1</p>
<p>details para 2</p>
</details>

This looks closely related to #3694

@tarleb
Copy link
Collaborator

tarleb commented May 20, 2020

As a work-around, stop pandoc from adding additional <p> tags by marking summary as a raw HTML block:

<details>
```{=html}
<summary>Show me:</summary>
```
details para 1

details para 2
</details>

@jgm jgm closed this as completed in f6dfacf May 20, 2020
@jgm
Copy link
Owner

jgm commented May 20, 2020

fixed. Note that pandoc's parsing scheme will require a blank line after details para 2 if you want it to be treated as a paragraph, and not "plain inline content."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants