diff --git a/autotests/folding/highlight.rb.fold b/autotests/folding/highlight.rb.fold
--- a/autotests/folding/highlight.rb.fold
+++ b/autotests/folding/highlight.rb.fold
@@ -549,3 +549,25 @@
:@abc
:@@abc
:$abc
+
+# squiggly HEREDOC
+ <<~HEREDOC
+ Hello!!
+ HEREDOC
+
+# HEREDOC with backticks
+<<`HEREDOC`
+ echo "hello"
+HEREDOC
+
+# do not highlight HEREDOC markers after the "class" keyword
+# (singleton class definition) (bug: #358273)
+class <end
+singleton_class = ( class <end )
+
+# highlight regular expressions after ": " (bug: #361875)
+get 'files/:slug/:filename', to: 'files#download', slug: /^[a-z]+$/, filename: %r|^[/\s]+$|
+@@hello!: /regexp/
+[]=: %r!regexp!
diff --git a/autotests/html/highlight.rb.html b/autotests/html/highlight.rb.html
--- a/autotests/html/highlight.rb.html
+++ b/autotests/html/highlight.rb.html
@@ -555,4 +555,26 @@
:@abc
:@@abc
:$abc
+
+# squiggly HEREDOC
+ <<~HEREDOC
+ Hello!!
+ HEREDOC
+
+# HEREDOC with backticks
+<<`HEREDOC`
+ echo "hello"
+HEREDOC
+
+# do not highlight HEREDOC markers after the "class" keyword
+# (singleton class definition) (bug: #358273)
+class <<Foo = Object.new
+ attr_accessor :foo
+end
+singleton_class = ( class <<foo; self; end )
+
+# highlight regular expressions after ": " (bug: #361875)
+get 'files/:slug/:filename', to: 'files#download', slug: /^[a-z]+$/, filename: %r|^[/\s]+$|
+@@hello!: /regexp/
+[]=: %r!regexp!