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

AlertBlock content not rending properly #780

Closed
jorge-moreira opened this issue Mar 14, 2024 · 3 comments
Closed

AlertBlock content not rending properly #780

jorge-moreira opened this issue Mar 14, 2024 · 3 comments
Labels

Comments

@jorge-moreira
Copy link

jorge-moreira commented Mar 14, 2024

Hi,

I was trying the new version and it seems that the paragraphs within the AlertBlock are not being rendered.

How to reproduce

Markdown example

> [!NOTE]
> Highlights information that users should take into account, even when skimming.
> 
> Testing rendering for multiple lines
> 
> `Inline code testing`
> 
> Other line
> 
> > Nested quote
> >
> > Final nested quote line
> 
> Final line of alert

Expected:

Note

Highlights information that users should take into account, even when skimming.

Testing rendering for multiple lines

Inline code testing

Other line

Nested quote

Final nested quote line

Final line of alert

HTML rendered result

<div class="markdown-alert markdown-alert-note">
<p class="markdown-alert-title"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>Note</p>
<p>Highlights information that users should take into account, even when skimming.</p>
<p></p>
<p></p>
<p></p>
<blockquote>
<p></p>
<p></p>
</blockquote>
<p></p>
</div>

When debugging, I noticed that the paragraph block, when was being rendered, the ContainerInline is null, and that way, the paragraph is not rendered:
image

@xoofx xoofx added the bug label Mar 14, 2024
@xoofx
Copy link
Owner

xoofx commented Mar 14, 2024

Thanks for the repro, indeed, it's not working at all 😅

The issue is in ProcessInlines.ProcessInlines that maintain the stack of the blocks being processed, as we are changing from an inline expansion the parent block, the loop doesn't pick-up the new parent, and as we removed all children from the QuoteBlock (replaced by an AlertBlock), then it exits the loop (and doesn't process the AlertBlock because it is not in the stack of the element being processed by the loop)

Gonna have to think about how to proceed. e.g It might not be a good idea to change the structure of blocks while parsing inlines, so I might have to remove AlertBlock and add attributes to the QuoteBlock.

@xoofx xoofx closed this as completed in 6549d3b Mar 14, 2024
@xoofx
Copy link
Owner

xoofx commented Mar 14, 2024

Temporary fix 6549d3b until this is revisited. The fix is not ideal, so for now I kept the code internal.

xoofx added a commit that referenced this issue Mar 14, 2024
@jorge-moreira
Copy link
Author

Temporary fix 6549d3b until this is revisited. The fix is not ideal, so for now I kept the code internal.

I'll also take a look into it. Thank you once again 🙇

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

No branches or pull requests

2 participants