Skip to content

Commit

Permalink
Remove _ suffix (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutsu3 authored Jan 13, 2021
1 parent 1e35d3c commit 3d2a467
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions linkify_it/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def func(text, pos):

def _create_normalizer(self):
def func(match):
self._normalize(match)
self.normalize(match)

return func

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/test_linkify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 3d2a467

Please sign in to comment.