SyntaxHighlightingComponent.registerCodeBlockLanguage method
SyntaxHighlightingComponent › registerCodeBlockLanguage
Registers a fenced code block language, highlighting it in the editor and, optionally, in reading view.Signature:
registerCodeBlockLanguage(params: SyntaxHighlightingComponentRegisterCodeBlockLanguageParams): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
| params | SyntaxHighlightingComponentRegisterCodeBlockLanguageParams | The parameters for registering the language. |
Returns: Promise<void> — A Promise that resolves when the language is registered.
Example:
await component.registerCodeBlockLanguage({ editorMode: 'text/typescript', language: 'my-language', prismGrammar: 'typescript'});