From f01d02ecfe0013fb62037803e04049ea4f42bd9e Mon Sep 17 00:00:00 2001 From: Claudio Klingler Date: Wed, 19 Jun 2024 16:36:38 +0200 Subject: [PATCH] Fix config handling. --- src/mkdocs_ezglossary_plugin/plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mkdocs_ezglossary_plugin/plugin.py b/src/mkdocs_ezglossary_plugin/plugin.py index 853cba9..6a28127 100644 --- a/src/mkdocs_ezglossary_plugin/plugin.py +++ b/src/mkdocs_ezglossary_plugin/plugin.py @@ -217,6 +217,8 @@ def _get_defs(self, section, term): if len(defs) > 0: return defs log.warning(f'plurals: {self.config.plurals}') + if 'plurals' not in self.config: + return if self.config.plurals == 'inflect': singular = engine.singular_noun(term) if not singular: @@ -224,7 +226,7 @@ def _get_defs(self, section, term): return defs log.warning(f'singular is: `{singular}`') return self._glossary.get(section, singular, 'defs') - if self.config.plurals and self.config.plurals not in plurals: + if self.config.plurals not in plurals: log.error('no plurals definition for `{self.config.plurals`') return defs _plurals = plurals[self.config.plurals]