diff --git a/pyglossary/glossary_types.py b/pyglossary/glossary_types.py index ab413581a..eb52c47b9 100644 --- a/pyglossary/glossary_types.py +++ b/pyglossary/glossary_types.py @@ -201,7 +201,7 @@ def wordTitleStr( self, word: str, sample: str = "", - _class: str = "", + class_: str = "", ) -> str: ... def getConfig(self, name: str, default: str | None) -> str | None: ... diff --git a/pyglossary/glossary_v2.py b/pyglossary/glossary_v2.py index 5fe50dbfa..c3a1ff1a9 100644 --- a/pyglossary/glossary_v2.py +++ b/pyglossary/glossary_v2.py @@ -565,7 +565,7 @@ def wordTitleStr( self, word: str, sample: str = "", - _class: str = "", + class_: str = "", ) -> str: """ Return title tag for words. @@ -587,8 +587,8 @@ def wordTitleStr( if not sample: sample = word tag = self.titleTag(sample) - if _class: - return f'<{tag} class="{_class}">{word}
' + if class_: + return f'<{tag} class="{class_}">{word}
' return f"<{tag}>{word}
" def getConfig(self, name: str, default: str | None) -> str | None: diff --git a/pyglossary/plugins/html_dir.py b/pyglossary/plugins/html_dir.py index 050f85258..cca7fcf6a 100644 --- a/pyglossary/plugins/html_dir.py +++ b/pyglossary/plugins/html_dir.py @@ -492,7 +492,7 @@ def addLinks(text: str, pos: int) -> None: title = glos.wordTitleStr( wordSep.join(words), sample=entry.l_word[0], - _class="headword", + class_="headword", ) if not title: diff --git a/tests/deprecated/glossary_test.py b/tests/deprecated/glossary_test.py index e32faa85d..ed9310234 100644 --- a/tests/deprecated/glossary_test.py +++ b/tests/deprecated/glossary_test.py @@ -1065,7 +1065,7 @@ def test_wordTitleStr_b1(self): def test_wordTitleStr_b2(self): glos = self.glos = Glossary() self.assertEqual( - glos.wordTitleStr("test1", _class="headword"), + glos.wordTitleStr("test1", class_="headword"), 'test1
', ) diff --git a/tests/glossary_v2_test.py b/tests/glossary_v2_test.py index 51f18c73b..b66cfcf1a 100644 --- a/tests/glossary_v2_test.py +++ b/tests/glossary_v2_test.py @@ -950,7 +950,7 @@ def test_wordTitleStr_b1(self): def test_wordTitleStr_b2(self): glos = self.glos = Glossary() self.assertEqual( - glos.wordTitleStr("test1", _class="headword"), + glos.wordTitleStr("test1", class_="headword"), 'test1
', )