diff --git a/linkify_it/main.py b/linkify_it/main.py index 7e6af33..b06a7b3 100644 --- a/linkify_it/main.py +++ b/linkify_it/main.py @@ -189,7 +189,7 @@ def func(text, pos): def _create_normalizer(self): def func(match): - self._normalize(match) + self.normalize(match) return func @@ -590,11 +590,11 @@ def tlds(self, list_tlds, keep_old=False): self._compile() return self - def _normalize(self, match): + def normalize(self, match): """Default normalizer (if schema does not define it's own). Args: - match (): + match (:class:`linkify_it.main.Match`): Match result """ if not match.schema: match.url = "http://" + match.url diff --git a/test/test_linkify.py b/test/test_linkify.py index afa4f00..79bf297 100644 --- a/test/test_linkify.py +++ b/test/test_linkify.py @@ -20,7 +20,7 @@ def dummy(_): def test_links(number, line, expected): linkifyit = LinkifyIt(options={"fuzzy_ip": True}) - linkifyit._normalize = dummy + linkifyit.normalize = dummy assert linkifyit.pretest(line) is True assert linkifyit.test("\n" + line + "\n") is True @@ -35,6 +35,6 @@ def test_links(number, line, expected): def test_not_links(number, line, expected): linkifyit = LinkifyIt() - linkifyit._normalize = dummy + linkifyit.normalize = dummy assert linkifyit.test(line) is False