File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export default class HTMLCodeBlockElement extends HTMLElement {
77 * you need to assign it directly to `HTMLCodeBlockElement.endgine`.
88 * Currently, only highlight.js is assumed.
99 */
10- static endgine : HLJSApi ;
10+ static endgine : any ;
1111
1212 /**
1313 * Returns the result of highlighting the received source code string.
@@ -17,7 +17,7 @@ export default class HTMLCodeBlockElement extends HTMLElement {
1717 */
1818 static highlight (
1919 src : string ,
20- options : HighlightOptions ,
20+ options ? : HighlightOptions ,
2121 ) : {
2222 value : string ,
2323 } {
@@ -27,18 +27,20 @@ export default class HTMLCodeBlockElement extends HTMLElement {
2727 throw new Error ( 'The syntax highlighting engine is not set to `HTMLCodeBlockElement.endgine`.' ) ;
2828 }
2929
30+ const hljs : HLJSApi = endgine ;
31+
3032 if (
3133 // Verifying the existence of a language
3234 options ?. language &&
33- endgine . getLanguage ( options . language )
35+ hljs . getLanguage ( options . language )
3436 ) {
35- return endgine . highlight (
37+ return hljs . highlight (
3638 src ,
3739 options ,
3840 ) ;
3941 }
4042
41- return endgine . highlightAuto ( src ) ;
43+ return hljs . highlightAuto ( src ) ;
4244 }
4345
4446 #slots = ( ( ) => {
You can’t perform that action at this time.
0 commit comments