File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,31 @@ function outputCodeblocks() {
122122 } ) ;
123123}
124124
125+ function defaultLanguageTitles ( ) {
126+ return definePlugin ( {
127+ name : "Adds language-specific default titles." ,
128+ hooks : {
129+ preprocessLanguage : async ( context ) => {
130+ switch ( context . codeBlock . language ) {
131+ case "powershell" : {
132+ context . codeBlock . props . title ??= "PowerShell" ;
133+ break ;
134+ }
135+ default : {
136+ return ;
137+ }
138+ }
139+ } ,
140+ } ,
141+ } ) ;
142+ }
143+
125144export default {
126- plugins : [ workersPlaygroundButton ( ) , outputCodeblocks ( ) ] ,
145+ plugins : [
146+ workersPlaygroundButton ( ) ,
147+ outputCodeblocks ( ) ,
148+ defaultLanguageTitles ( ) ,
149+ ] ,
127150 themes : [ darkTheme , lightTheme ] ,
128151 styleOverrides : {
129152 textMarkers : {
You can’t perform that action at this time.
0 commit comments