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

Code blocks break <details> rendering #34

Open
ghost opened this issue Aug 26, 2022 · 2 comments
Open

Code blocks break <details> rendering #34

ghost opened this issue Aug 26, 2022 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 26, 2022

Bug Description

Within a details block, rendering of code blocks seems to be broken. Adding an empty line after the opening block breaks the rendering.

How to Reproduce

Works

Input

<details>
<summary>Click here to see build profile </summary>
```xml
<test />
```
</details>

Output

<ac:structured-macro ac:name="expand"><ac:parameter ac:name="title">Click here to see build profile </ac:parameter><ac:rich-text-body><p><code>xml
&lt;test /&gt;</code></p>
</ac:rich-text-body></ac:structured-macro>

Broken

Input

(newline after xml codefences

<details>
<summary>Click here to see build profile </summary>
```xml

<test />
```
</details>

Output

<ac:structured-macro ac:name="expand"><ac:parameter ac:name="title">Click here to see build profile </ac:parameter><ac:rich-text-body><p><code>xml</p>
<p>&lt;test /&gt;</code></p>
</ac:rich-text-body></ac:structured-macro>
@mihaeu
Copy link
Owner

mihaeu commented Oct 10, 2022

After playing around with several ideas, I think the best way here is to highlight the error and have the user fix it. Fixing it automatically would mean rewriting the lexer of marked.

Instead, I tried https://www.npmjs.com/package/node-libxml and verifying that the XML is well-formed does the job.

@hudrid
Copy link

hudrid commented Apr 11, 2024

Hello, @mihaeu!
The bug is repeated not only in code blocks.
If there is an empty line between </summary> and </details> tags, rendering details in Confluence fails.

How to Reproduce

Works

Example 1:

<details>
<summary>example 1</summary>
Some text
</details>

Example 2 (this works, but doesn't work in Gitlab, Github, VsCode, and thus when publishing via site generators):

<details>
<summary>example 2</summary>
```xml
<test />
```
</details>

Broken

Example 1:

<details>
<summary>example 1</summary>

Some text
</details>

Example 2:

<details>
<summary>example 2</summary>
Some text

</details>

Example 3:

<details>
<summary>example 3</summary>

```xml
<test />
```
</details>

Example 4:

<details>
<summary>example 4</summary>
```xml
<test />
```

</details>

Example 5:

<details>
<summary>example 5</summary>
```xml

<test />
```
</details>

But

  1. If I use the <details> tag with no empty lines inside <td> tag:
<td>
<details><summary>example 6</summary>
```xml
<test />
```
</details>
</td>

an error ocurs:
image

  1. With empty line:
<td>
<details><summary>example 6</summary>

```xml
<test />
```
</details>
</td>

it looks like this (without dropdown):

image

@hudrid hudrid mentioned this issue Apr 11, 2024
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

2 participants