diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-09 06:09:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-09 06:09:18 +0300 |
commit | 276941b2c436678b956025ae2958e11ccbeac55d (patch) | |
tree | 5e88dd0b0e167972b4433b31c4381d7be66187e0 /lib/gitlab/front_matter.rb | |
parent | 25096948f0f1837d0217cbd45394aa875756f054 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/front_matter.rb')
-rw-r--r-- | lib/gitlab/front_matter.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/front_matter.rb b/lib/gitlab/front_matter.rb index 5c5c74ca1a0..093501e860b 100644 --- a/lib/gitlab/front_matter.rb +++ b/lib/gitlab/front_matter.rb @@ -11,12 +11,12 @@ module Gitlab DELIM = Regexp.union(DELIM_LANG.keys) PATTERN = %r{ - \A(?:[^\r\n]*coding:[^\r\n]*\R)? # optional encoding line - \s* + \A(?<encoding>[^\r\n]*coding:[^\r\n]*\R)? # optional encoding line + (?<before>\s*) ^(?<delim>#{DELIM})[ \t]*(?<lang>\S*)\R # opening front matter marker (optional language specifier) (?<front_matter>.*?) # front matter block content (not greedy) ^(\k<delim> | \.{3}) # closing front matter marker - \s* + [^\S\r\n]*(\R|\z) }mx.freeze end end |