fix: make syntax highlighting for md js code blocks same as for payload samples

This commit is contained in:
Roman Hotsiy 2019-01-23 19:56:13 +07:00
parent 007752dfc4
commit d197c0feda
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -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
*/