Skip to content

Commit

Permalink
fix: fix prism highlight signature
Browse files Browse the repository at this point in the history
The new typings define higligth as follow:

```typescript
/*
 * @param text A string with the code to be highlighted.
 * @param grammar An object containing the tokens to use.
 *
 * Usually a language definition like `Prism.languages.markup`.
 * @param language The name of the language definition passed to `grammar`.
 * @returns The highlighted HTML.
 *
 * @example
 * Prism.highlight('var foo = true;', Prism.languages.js, 'js');
 */
export function highlight(
	text: string,
	grammar: Grammar,
	language: string
): string;
```
  • Loading branch information
cexbrayat committed Mar 27, 2019
1 parent 7363537 commit b33bcff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion projects/demo/src/app/prism.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import 'prismjs/components/prism-typescript';
export class PrismService {

highlight(code: string, lang: string) {
return prism.highlight(code.trim(), prism.languages[lang]);
return prism.highlight(code.trim(), prism.languages[lang], lang);
}
}

0 comments on commit b33bcff

Please sign in to comment.