mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 01:54:08 +03:00
fix: make syntax highlighting for md js code blocks same as for payload samples
This commit is contained in:
parent
007752dfc4
commit
d197c0feda
|
@ -21,6 +21,30 @@ import 'prismjs/components/prism-swift.js';
|
|||
|
||||
const DEFAULT_LANG = 'clike';
|
||||
|
||||
Prism.languages.insertBefore(
|
||||
'javascript',
|
||||
'string',
|
||||
{
|
||||
'property string': {
|
||||
pattern: /([{,]\s*)"(?:\\.|[^\\"\r\n])*"(?=\s*:)/i,
|
||||
lookbehind: true,
|
||||
},
|
||||
} as any,
|
||||
undefined as any,
|
||||
);
|
||||
|
||||
Prism.languages.insertBefore(
|
||||
'javascript',
|
||||
'punctuation',
|
||||
{
|
||||
property: {
|
||||
pattern: /([{,]\s*)[a-z]\w*(?=\s*:)/i,
|
||||
lookbehind: true,
|
||||
},
|
||||
},
|
||||
undefined as any,
|
||||
);
|
||||
|
||||
/**
|
||||
* map language names to Prism.js names
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user