From 31d99cfbe984763e89cbaf702b6e414b8a830363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <1289205+lahwaacz@users.noreply.github.com> Date: Sun, 11 May 2025 14:39:18 +0200 Subject: [PATCH] Add type hints: mwparserfromhell.definitions --- src/mwparserfromhell/definitions.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mwparserfromhell/definitions.py b/src/mwparserfromhell/definitions.py index 3258063..14c4ade 100644 --- a/src/mwparserfromhell/definitions.py +++ b/src/mwparserfromhell/definitions.py @@ -113,32 +113,32 @@ MARKUP_TO_HTML = { } -def get_html_tag(markup): +def get_html_tag(markup: str) -> str: """Return the HTML tag associated with the given wiki-markup.""" return MARKUP_TO_HTML[markup] -def is_parsable(tag): +def is_parsable(tag: str) -> bool: """Return if the given *tag*'s contents should be passed to the parser.""" return tag.lower() not in PARSER_BLACKLIST -def is_visible(tag): +def is_visible(tag: str) -> bool: """Return whether or not the given *tag* contains visible text.""" return tag.lower() not in INVISIBLE_TAGS -def is_single(tag): +def is_single(tag: str) -> bool: """Return whether or not the given *tag* can exist without a close tag.""" return tag.lower() in SINGLE -def is_single_only(tag): +def is_single_only(tag: str) -> bool: """Return whether or not the given *tag* must exist without a close tag.""" return tag.lower() in SINGLE_ONLY -def is_scheme(scheme, slashes=True): +def is_scheme(scheme: str, slashes: bool = True) -> bool: """Return whether *scheme* is valid for external links.""" scheme = scheme.lower() if slashes: