feat(graphql): treat block strings as markdown

pull/2748/head
Pavel Lang
parent d605a30cc7
commit 1ff4648d05
No known key found for this signature in database
GPG Key ID: 623A223A57974B55

@ -100,15 +100,9 @@ testTokenization('graphql', [
], ],
}, },
{ {
line: 'Node interface', line: 'This is MarkDown',
tokens: [ tokens: [
{ startIndex: 0, type: "string.gql" } { startIndex: 0, type: "" }
],
},
{
line: '- allows (re)fetch arbitrary entity only by ID',
tokens: [
{ startIndex: 0, type: "string.gql" }
], ],
}, },
{ {

@ -115,14 +115,19 @@ export const language = <ILanguage>{
// delimiter: after number because of .\d floats // delimiter: after number because of .\d floats
[/[;,.]/, 'delimiter'], [/[;,.]/, 'delimiter'],
[/"""/, 'string', '@mlstring'], [/"""/,
{ token: 'string', next: '@mlstring', nextEmbedded: 'markdown' }
],
// strings // strings
[/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string
[/"/, { token: 'string.quote', bracket: '@open', next: '@string' }], [/"/, { token: 'string.quote', bracket: '@open', next: '@string' }],
], ],
mlstring: [[/[^"]+/, 'string'], ['"""', 'string', '@pop']], mlstring: [
[/[^"]+/, 'string'],
['"""', { token: 'string', next: '@pop', nextEmbedded: '@pop' }]
],
string: [ string: [
[/[^\\"]+/, 'string'], [/[^\\"]+/, 'string'],

Loading…
Cancel
Save