Skip to content

Commit 2ec94fc

Browse files
authored
Add support for alerts (#26)
1 parent 9de4e73 commit 2ec94fc

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

fixture.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111

1212
<img src="image.png" width="182" align="right">
1313

14+
#### Alerts
15+
16+
> [!NOTE]
17+
> Highlights information that users should take into account, even when skimming.
18+
19+
> [!IMPORTANT]
20+
> Crucial information necessary for users to succeed.
21+
22+
> [!WARNING]
23+
> Critical content demanding immediate user attention due to potential risks.
1424
1525
### Code snippet
1626

index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ const ALLOW_CLASS = new Set([
111111
'.contains-task-list',
112112
'.task-list-item',
113113
'.task-list-item-checkbox',
114+
// For Markdown alerts.
115+
'.markdown-alert',
116+
'.color-fg-accent',
117+
'.color-fg-attention',
118+
'.color-fg-done',
119+
'.text-semibold',
120+
'.d-inline-flex',
121+
'.flex-items-center',
122+
'.mb-1',
114123
]);
115124

116125
function extractStyles(rules, ast) {

0 commit comments

Comments
 (0)