diff --git a/components.json b/components.json index 5e122eaae2..57b4f41ac6 100644 --- a/components.json +++ b/components.json @@ -397,6 +397,7 @@ }, "graphql": { "title": "GraphQL", + "optional": ["markdown"], "owner": "Golmote" }, "groovy": { diff --git a/components/prism-graphql.js b/components/prism-graphql.js index 22107ad412..0a326dd54c 100644 --- a/components/prism-graphql.js +++ b/components/prism-graphql.js @@ -1,5 +1,16 @@ Prism.languages.graphql = { 'comment': /#.*/, + 'multiline-string': { + pattern: /"""[\s\S]*?"""/, + greedy: true, + alias: 'string', + inside: { + 'language-markdown': { + pattern: /[\s\S]+/, + inside: Prism.languages.markdown + } + } + }, 'string': { pattern: /"(?:\\.|[^\\"\r\n])*"/, greedy: true diff --git a/examples/prism-graphql.html b/examples/prism-graphql.html index 12113a9d80..876ac9bb70 100644 --- a/examples/prism-graphql.html +++ b/examples/prism-graphql.html @@ -28,4 +28,19 @@

Keywords

id name profilePic(size: 50) -} \ No newline at end of file +} + +Markdown inside of descriptions require markdown to be loaded. On this page, checking Markdown before checking GraphQL should make the example below work properly. + +

Descriptions

+
"""
+This is a multiline description
+# Heading
+[Prism](http://www.prismjs.com)
+
+It can contain **Markdown
+	on multiple lines**
+"""
+
+"This is a single line description"
+
\ No newline at end of file