Skip to content

Commit 91589f0

Browse files
committed
feat(#141): change naming to generic 'alerts'
I feel this is clearer as not to be mislead to think that the 5 GitHub alerts are the only thing supported by plugin name alone. They're generic alerts, with GitHub default styles.
1 parent 1288d69 commit 91589f0

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ for (const marker in mergedIcons) {
4040
const fallbackIconOpt = config.alertsOptions?.fallbackIcon ?? mergedIcons['note'];
4141
const fallbackIcon = resolveIcon(fallbackIconOpt);
4242

43-
const MarkdownItGitHubAlerts = (md: MarkdownIt) => {
43+
const MarkdownItAlerts = (md: MarkdownIt) => {
4444
const markerNameRE = '\\w+';
4545
const RE = new RegExp(
4646
`^\\\\?\\[\\!(${markerNameRE})\\]([^\\n\\r]*)`,
4747
matchCaseSensitive ? '' : 'i',
4848
);
4949

50-
md.core.ruler.after('block', 'github-alerts', (state) => {
50+
md.core.ruler.after('block', 'alerts', (state) => {
5151
const tokens = state.tokens;
5252
for (let i = 0; i < tokens.length; i++) {
5353
if (tokens[i].type === 'blockquote_open') {
@@ -91,4 +91,4 @@ function capitalize(str: string) {
9191
return str.charAt(0).toUpperCase() + str.slice(1);
9292
}
9393

94-
export default MarkdownItGitHubAlerts;
94+
export default MarkdownItAlerts;

src/parser/markdown.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import highlight from './highlight.js';
66
import graphviz from './dot.js';
77
import mermaid from './mermaid.js';
88
import wikiLinks from './wiki-links.js';
9-
import githubAlerts from './github-alerts.js';
9+
import alerts from './alerts.js';
1010
import config from '../config.js';
1111
import { Renderer } from './parser.js';
1212

@@ -72,7 +72,7 @@ mdit.use(anchor, {
7272
});
7373
mdit.use(copycode);
7474
mdit.use(graphviz);
75-
mdit.use(githubAlerts);
75+
mdit.use(alerts);
7676
mdit.use(mermaid);
7777
mdit.use(wikiLinks);
7878

0 commit comments

Comments
 (0)