File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 33 */
44
55import { visit } from 'unist-util-visit' ;
6+
7+ const asideMapping = {
8+ tip : '提示' ,
9+ warning : '警告' ,
10+ todo : 'TODO'
11+ }
12+
613export default function customAsides (
714 options = {
815 mapping : { } ,
@@ -49,7 +56,7 @@ export default function customAsides(
4956 children : [
5057 {
5158 type : 'text' ,
52- value : `${ className } ` ,
59+ value : `${ asideMapping [ className ] } ` ,
5360 } ,
5461 ] ,
5562 } ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ W> hello world
2121 expect ( contents ) . toContain ( '<aside class="warning"' ) ;
2222 expect ( contents ) . toContain ( '<h6 class="warning__prefix"' ) ;
2323 expect ( contents ) . toContain ( 'warning' ) ;
24- expect ( contents ) . toMatchSnapshot ( ) ;
24+ expect ( contents . replace ( '警告' , 'warning' ) . replace ( '提示' , 'tip' ) . replace ( 'TODO' , 'todo' ) ) . toMatchSnapshot ( ) ;
2525 }
2626 ) ;
2727 } ) ;
You can’t perform that action at this time.
0 commit comments