Commit f0158607 authored by Alex Kalderimis's avatar Alex Kalderimis

Prefer link_reference_pattern to reference_pattern

Link reference_patterns are more specific, so if they overlap we should
prefer the link.
parent 5cd20d8d
......@@ -297,8 +297,8 @@ module Banzai
@references_per[parent_type] ||= begin
refs = Hash.new { |hash, key| hash[key] = Set.new }
regex = [
object_class.reference_pattern,
object_class.link_reference_pattern
object_class.link_reference_pattern,
object_class.reference_pattern
].compact.reduce { |a, b| Regexp.union(a, b) }
nodes.each do |node|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment