From 738fafba81c4c08e8daa6659b5007c2b8faec61d Mon Sep 17 00:00:00 2001 From: gzwongkk Date: Mon, 18 Sep 2023 02:19:45 +0800 Subject: [PATCH] Fix regex to limit keyword scope to fields (#1629) improved version of the original fix contributed by @paberr in #1429 --- _plugins/hideCustomBibtex.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_plugins/hideCustomBibtex.rb b/_plugins/hideCustomBibtex.rb index 4a852fde6a6e..ac12ab0f3c5c 100644 --- a/_plugins/hideCustomBibtex.rb +++ b/_plugins/hideCustomBibtex.rb @@ -4,7 +4,7 @@ def hideCustomBibtex(input) keywords = @context.registers[:site].config['filtered_bibtex_keywords'] keywords.each do |keyword| - input = input.gsub(/^.*#{keyword}.*$\n/, '') + input = input.gsub(/^.*\b#{keyword}\b *= *\{.*$\n/, '') end return input