You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR continues the work on #10429 and makes it functional by adding allowed_classes. This ensures that the generated alert blocks won't be cleaned by the sanitizer. Tests have also been added to confirm everything works as expected.
Currently, alert icon support is handled via pure CSS for the following reasons:
Comrak does not currently insert alert icon nodes.
While we could somehow insert svg alert icon with a custom renderer, our sanitizer will remove SVG. :/ We could still use this method to inject a placeholder node and load icon via CSS, though. (the point would be: how important is it to have a placeholder node for the alert icon in the rendered HTML?)
There's also an alternative solution which doesn't require serving the SVG icon via CSS. This might require parsing the sanitized document and inserting the SVG into it.
LGTM, though in the screenshot it looks like there is a lot of padding at the bottom of the alert. is that intentional? I couldn't find anything in the CSS that would explicitly set it like this. 🤔
LGTM, though in the screenshot it looks like there is a lot of padding at the bottom of the alert. is that intentional? I couldn't find anything in the CSS that would explicitly set it like this. 🤔
Ah, good catch! It shouldn't have a margin-bottom for the last child.
C-enhancement ✨Category: Adding new behavior or a change to the way an existing feature works
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR continues the work on #10429 and makes it functional by adding
allowed_classes
. This ensures that the generated alert blocks won't be cleaned by the sanitizer. Tests have also been added to confirm everything works as expected.Thanks, @kbdharun, for the work on #10429.
preview:

