From e5fcc3dbb2796e312afc6a8bfa93752f05e5238d Mon Sep 17 00:00:00 2001 From: julp Date: Mon, 19 Aug 2019 16:34:59 +0200 Subject: [PATCH] Avoid multiple interpolations in regexpes and replace `%r/./` by `%r/.+?(?=#{close})|.+/mo` to handle comments --- lib/rouge/lexers/eex.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rouge/lexers/eex.rb b/lib/rouge/lexers/eex.rb index f51e1f5497..2c3784ce0d 100644 --- a/lib/rouge/lexers/eex.rb +++ b/lib/rouge/lexers/eex.rb @@ -29,20 +29,20 @@ def initialize(opts={}) rule open, Comment::Preproc, :elixir - rule %r/.+?(?=#{open})|.+/m do + rule %r/.+?(?=#{open})|.+/mo do delegate parent end end state :comment do rule close, Comment, :pop! - rule %r/./, Comment + rule /.+?(?=#{close})|.+/mo, Comment end state :elixir do rule close, Comment::Preproc, :pop! - rule %r/.+?(?=#{close})|.+/m do + rule %r/.+?(?=#{close})|.+/mo do delegate @elixir_lexer end end