Bibliofile
(Bibliofile)
October 14, 2016, 10:04pm
1
There is an issue with code blocks within details
tags. I won’t even try to guess why this is broken. If you put the following code into a post, instead of the two distinct details blocks with code blocks within them that you would expect, you get a single details block with stripped HTML inside
<details><summary>Summary</summary>
```HTML
<script>alert("Text");</script>
```
</details>
<details><summary>Summary2</summary>
```HTML
<script>alert("Text"); </script>
```
</details>
Example:
Summary
<script>alert("Text");</script>
Summary2
<script>alert("Text"); </script>
jomaxro
(Joshua Rosenfeld)
October 14, 2016, 10:09pm
2
The issue isn’t with details tags, it’s with the language you listed for the code block. HTML
isn’t a valid language. You need to use html
.
This works:
<details><summary>Summary</summary>
```html
<script>alert("Text");</script>
```
</details>
<details><summary>Summary2</summary>
```html
<script>alert("Text"); </script>
```
</details>
Summary
<script>alert("Text");</script>
Summary2
<script>alert("Text"); </script>
4 Likes
Bibliofile
(Bibliofile)
October 14, 2016, 10:46pm
3
Thank you! No wonder I couldn’t seem to reproduce this with any other language…
2 Likes