mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
feat(graphql): treat block strings as markdown
This commit is contained in:
parent
d605a30cc7
commit
1ff4648d05
2 changed files with 9 additions and 10 deletions
|
|
@ -100,15 +100,9 @@ testTokenization('graphql', [
|
|||
],
|
||||
},
|
||||
{
|
||||
line: 'Node interface',
|
||||
line: 'This is MarkDown',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: "string.gql" }
|
||||
],
|
||||
},
|
||||
{
|
||||
line: '- allows (re)fetch arbitrary entity only by ID',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: "string.gql" }
|
||||
{ startIndex: 0, type: "" }
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -115,14 +115,19 @@ export const language = <ILanguage>{
|
|||
// delimiter: after number because of .\d floats
|
||||
[/[;,.]/, 'delimiter'],
|
||||
|
||||
[/"""/, 'string', '@mlstring'],
|
||||
[/"""/,
|
||||
{ token: 'string', next: '@mlstring', nextEmbedded: 'markdown' }
|
||||
],
|
||||
|
||||
// strings
|
||||
[/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string
|
||||
[/"/, { token: 'string.quote', bracket: '@open', next: '@string' }],
|
||||
],
|
||||
|
||||
mlstring: [[/[^"]+/, 'string'], ['"""', 'string', '@pop']],
|
||||
mlstring: [
|
||||
[/[^"]+/, 'string'],
|
||||
['"""', { token: 'string', next: '@pop', nextEmbedded: '@pop' }]
|
||||
],
|
||||
|
||||
string: [
|
||||
[/[^\\"]+/, 'string'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue