Fix issues spotted by @fredZen in #1802
This commit is contained in:
parent
f2f7fae6c9
commit
c60c58ff8b
2 changed files with 5 additions and 2 deletions
|
@ -50,6 +50,9 @@ class AttestationTemplate < ApplicationRecord
|
|||
def used_tags
|
||||
delimiters_regex = /--(?<capture>((?!--).)*)--/
|
||||
|
||||
# We can't use flat_map as scan will return 3 levels of array,
|
||||
# using flat_map would give us 2, whereas flatten will
|
||||
# give us 1, which is what we want
|
||||
[title, body]
|
||||
.map { |str| str.scan(delimiters_regex) }
|
||||
.flatten
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue