fixed up a couple of TS compilation errors

This commit is contained in:
Stuart McGrigor 2019-08-08 23:15:28 +12:00
parent 2ab26e22f1
commit de831ad38a
2 changed files with 5 additions and 2 deletions

View File

@ -28,7 +28,10 @@ export class ClipboardService {
if ((document as any).selection) { if ((document as any).selection) {
(document as any).selection.empty(); (document as any).selection.empty();
} else if (window.getSelection) { } else if (window.getSelection) {
window.getSelection().removeAllRanges(); let seln = window.getSelection();
if (seln) {
seln.removeAllRanges();
}
} }
} }

View File

@ -73,5 +73,5 @@ export function highlight(source: string, lang: string = DEFAULT_LANG): string {
if (!grammar) { if (!grammar) {
grammar = Prism.languages[mapLang(lang)]; grammar = Prism.languages[mapLang(lang)];
} }
return Prism.highlight(source, grammar); return Prism.highlight(source, grammar, lang);
} }