diff --git a/CHANGES.md b/CHANGES.md
index d8ef2f8890..10744aeb44 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -15,6 +15,7 @@ Core Grammars:
- enh(erlang) OTP25/27 maybe statement [nixxquality][]
- enh(dart) Support digit-separators in number literals [Sam Rawlins][]
- enh(csharp) add Contextual keywords `file`, `args`, `dynamic`, `record`, `required` and `scoped` [Alvin Joy][]
+- fix(ruby) - fix `|=` operator false positives (as block arguments) [Aboobacker MK]
New Grammars:
@@ -37,6 +38,7 @@ CONTRIBUTORS
[nixxquality]: https://github.com/nixxquality
[srawlins]: https://github.com/srawlins
[Alvin Joy]: https://github.com/alvinsjoy
+[Aboobacker MK]: https://github.com/tachyons
## Version 11.10.0
diff --git a/src/languages/ruby.js b/src/languages/ruby.js
index 026580e52b..91b2cb527d 100644
--- a/src/languages/ruby.js
+++ b/src/languages/ruby.js
@@ -350,7 +350,7 @@ export default function(hljs) {
},
{
className: 'params',
- begin: /\|/,
+ begin: /\|(?!=)/,
end: /\|/,
excludeBegin: true,
excludeEnd: true,
diff --git a/test/markup/ruby/blocks.expect.txt b/test/markup/ruby/blocks.expect.txt
new file mode 100644
index 0000000000..b44cd5ab8f
--- /dev/null
+++ b/test/markup/ruby/blocks.expect.txt
@@ -0,0 +1,7 @@
+[1, 2, 3].each do |num|
+ puts num
+end
+
+names |= users.map do |user|
+ user.name
+end
diff --git a/test/markup/ruby/blocks.txt b/test/markup/ruby/blocks.txt
new file mode 100644
index 0000000000..f9cda6d09a
--- /dev/null
+++ b/test/markup/ruby/blocks.txt
@@ -0,0 +1,7 @@
+[1, 2, 3].each do |num|
+ puts num
+end
+
+names |= users.map do |user|
+ user.name
+end