File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed
Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 11type AdmonitionType =
22 | "note"
3+ | "info"
4+ | "tip"
35 | "caution"
4- | "tip " ;
6+ | "warning " ;
57
68export default function Admonition (
79 props : { type : AdmonitionType ; children : any } ,
Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ export default function admonitionPlugin(md: any) {
66 for ( let i = 0 ; i < tokens . length ; i ++ ) {
77 if (
88 tokens [ i ] . type === "inline" &&
9- tokens [ i ] . content . match ( / ^ : : : ( n o t e | i n f o | t i p | c a u t i o n ) ( \s + ( .* ) ) ? / )
9+ tokens [ i ] . content . match ( / ^ : : : ( n o t e | i n f o | t i p | c a u t i o n | w a r n i n g ) ( \s + ( .* ) ) ? / )
1010 ) {
1111 const match = tokens [ i ] . content . match (
12- / ^ : : : ( n o t e | i n f o | t i p | c a u t i o n ) ( \s + ( .* ) ) ? / ,
12+ / ^ : : : ( n o t e | i n f o | t i p | c a u t i o n | w a r n i n g ) ( \s + ( .* ) ) ? / ,
1313 ) ;
1414 const type = match [ 1 ] ;
1515 const title = match [ 3 ] || type . charAt ( 0 ) . toUpperCase ( ) + type . slice ( 1 ) ;
Original file line number Diff line number Diff line change @@ -130,9 +130,13 @@ Use admonitions sparingly to highlight important information:
130130``` markdown
131131:::note Important supplementary information. :::
132132
133+ :::info Informational content (styled like note). :::
134+
133135:::tip Helpful advice for better usage. :::
134136
135137:::caution Warn about potential issues or gotchas. :::
138+
139+ :::warning Critical warnings that require immediate attention. :::
136140```
137141
138142### Tables
Original file line number Diff line number Diff line change 737737 @apply bg-runtime-50 dark:bg-runtime-950/30 dark:border
738738 dark:border-runtime-950 border-runtime-200;
739739 }
740- & .caution {
740+ & .caution ,
741+ & .warning {
741742 @apply bg-yellow-100 dark:bg-yellow-950/75 dark:border
742743 dark:border-yellow-400 border-yellow-200;
743744
You can’t perform that action at this time.
0 commit comments