Replace quotes in term lookup to allow matching multi-word term (#32284)

This commit is contained in:
Joakim Sørensen 2024-04-12 09:06:40 +02:00 committed by GitHub
parent ae4a4244f4
commit 3ecd83af26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,6 +20,7 @@ module Jekyll
end
def render(context)
@term.gsub!(/\"/, "")
entries = context.registers[:site].data["glossary"].select do |entry|
entry.key?("term") and (@term.casecmp(entry["term"]).zero? or (entry.key?("aliases") and entry["aliases"].any?{ |s| s.casecmp(@term)==0 }))
end