@@ -2,12 +2,6 @@ import { ThemeRegistration } from 'shiki';
22import * as hast_util_to_html_lib_types from 'hast-util-to-html/lib/types' ;
33import * as hast_types from 'hast' ;
44
5- interface Theme {
6- theme : ThemeRegistration ;
7- mapping : Map < string , string > ;
8- reverseMapping : Map < string , string > ;
9- }
10-
115export class ThemeMapper {
126 mapCounter : number ;
137 mapping : Map < string , string > ;
@@ -17,8 +11,8 @@ export class ThemeMapper {
1711 this . mapping = new Map ( ) ;
1812 }
1913
20- getTheme ( ) : Theme {
21- const theme : ThemeRegistration = {
14+ getTheme ( ) : ThemeRegistration {
15+ return {
2216 displayName : OBSIDIAN_THEME . displayName ,
2317 name : OBSIDIAN_THEME . name ,
2418 semanticHighlighting : OBSIDIAN_THEME . semanticHighlighting ,
@@ -37,14 +31,6 @@ export class ThemeMapper {
3731 return newToken ;
3832 } ) ,
3933 } ;
40-
41- const reverseMapping = this . getReverseMapping ( ) ;
42-
43- return {
44- theme : theme ,
45- mapping : this . mapping ,
46- reverseMapping : reverseMapping ,
47- } ;
4834 }
4935
5036 mapColor ( color : string ) : string {
@@ -58,14 +44,6 @@ export class ThemeMapper {
5844 }
5945 }
6046
61- private getReverseMapping ( ) : Map < string , string > {
62- const reverseMapping = new Map < string , string > ( ) ;
63- this . mapping . forEach ( ( value , key ) => {
64- reverseMapping . set ( value , key ) ;
65- } ) ;
66- return reverseMapping ;
67- }
68-
6947 fixAST ( ast : hast_util_to_html_lib_types . Parent ) : hast_util_to_html_lib_types . Parent {
7048 ast . children = ast . children . map ( child => {
7149 if ( child . type === 'element' ) {
0 commit comments