mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-09 21:42:15 +00:00
AlertBlock content not rending properly #662
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jorge-moreira on GitHub (Mar 14, 2024).
Hi,
I was trying the new version and it seems that the paragraphs within the
AlertBlockare not being rendered.How to reproduce
Markdown example
Expected:
HTML rendered result
When debugging, I noticed that the paragraph block, when was being rendered, the ContainerInline is null, and that way, the paragraph is not rendered:

@xoofx commented on GitHub (Mar 14, 2024):
Thanks for the repro, indeed, it's not working at all 😅
The issue is in
ProcessInlines.ProcessInlinesthat 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 commented on GitHub (Mar 14, 2024):
Temporary fix
6549d3b726until this is revisited. The fix is not ideal, so for now I kept the code internal.@jorge-moreira commented on GitHub (Mar 14, 2024):
I'll also take a look into it. Thank you once again 🙇