diff --git a/CHANGES.md b/CHANGES.md
index 60b97a9bac..a2c9720629 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -6,7 +6,8 @@ New Languages:
Language grammar improvements:
-- env(perl) Much improved regex detection (#2960) [Josh Goebel][]
+- enh(scala) fix triple quoted strings (#2987) [Josh Goebel][]
+- enh(perl) Much improved regex detection (#2960) [Josh Goebel][]
- enh(swift) Improved highlighting for operator and precedencegroup declarations. (#2938) [Steven Van Impe][]
- fix(xml) Support single-character namespaces. (#2957) [Jan Pilzer][]
- enh(ruby) Support for character literals (#2950) [Vaibhav Chanana][]
diff --git a/src/languages/scala.js b/src/languages/scala.js
index 817d834512..69aa988a24 100644
--- a/src/languages/scala.js
+++ b/src/languages/scala.js
@@ -29,23 +29,24 @@ export default function(hljs) {
const STRING = {
className: 'string',
variants: [
+ {
+ begin: '"""',
+ end: '"""'
+ },
{
begin: '"',
end: '"',
illegal: '\\n',
contains: [ hljs.BACKSLASH_ESCAPE ]
},
- {
- begin: '"""',
- end: '"""',
- relevance: 10
- },
{
begin: '[a-z]+"',
end: '"',
illegal: '\\n',
- contains: [ hljs.BACKSLASH_ESCAPE,
- SUBST ]
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ SUBST
+ ]
},
{
className: 'string',
diff --git a/test/markup/scala/strings.expect.txt b/test/markup/scala/strings.expect.txt
new file mode 100644
index 0000000000..43bb021949
--- /dev/null
+++ b/test/markup/scala/strings.expect.txt
@@ -0,0 +1 @@
+val s = """ this is a string "this is still a string" another quote: " after the quote """
diff --git a/test/markup/scala/strings.txt b/test/markup/scala/strings.txt
new file mode 100644
index 0000000000..26a45b3f58
--- /dev/null
+++ b/test/markup/scala/strings.txt
@@ -0,0 +1 @@
+val s = """ this is a string "this is still a string" another quote: " after the quote """