blob: 1c87c56c45e2154a692ebf7baa8eab360a3d6d23 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
module Gitlab
class StringRegexMarker < StringRangeMarker
# rubocop: disable CodeReuse/ActiveRecord
def mark(regex, group: 0, &block)
ranges = []
raw_line.scan(regex) do
begin_index, end_index = Regexp.last_match.offset(group)
ranges << (begin_index..(end_index - 1))
end
super(ranges, &block)
end
# rubocop: enable CodeReuse/ActiveRecord
end
end
|