Repository: tsutsu3/linkify-it-py

Issue:
Release on conda-forge
If you release on conda-forge, then I'll include in markdown-it-py conda requirements 😄 
(If you don't know, you need to make a PR to https://github.com/conda-forge/staged-recipes)

Discussion:
codecov-io: # [Codecov](https://codecov.io/gh/tsutsu3/linkify-it-py/pull/24?src=pr&el=h1) Report
> Merging [#24](https://codecov.io/gh/tsutsu3/linkify-it-py/pull/24?src=pr&el=desc) (e0e8af2) into [main](https://codecov.io/gh/tsutsu3/linkify-it-py/commit/1e35d3c46172864eb3e2c275d6e797a1b2acb43e?el=desc) (1e35d3c) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/tsutsu3/linkify-it-py/pull/24/graphs/tree.svg?width=650&height=150&src=pr&token=EIQIEC4MZY)](https://codecov.io/gh/tsutsu3/linkify-it-py/pull/24?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##             main      #24   +/-   ##
=======================================
  Coverage   97.64%   97.64%           
=======================================
  Files           3        3           
  Lines         297      297           
  Branches       51       51           
=======================================
  Hits          290      290           
  Misses          4        4           
  Partials        3        3           
```

| Flag | Coverage Δ | |
|---|---|---|
| pytests | `97.64% <ø> (ø)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.


------

[Continue to review full report at Codecov](https://codecov.io/gh/tsutsu3/linkify-it-py/pull/24?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/tsutsu3/linkify-it-py/pull/24?src=pr&el=footer). Last update [1e35d3c...e0e8af2](https://codecov.io/gh/tsutsu3/linkify-it-py/pull/24?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/README.md b/README.md
index 0763763..bd45d54 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,7 @@
 
 [![CI](https://github.com/tsutsu3/linkify-it-py/workflows/CI/badge.svg?branch=main)](https://github.com/tsutsu3/linkify-it-py/actions)
 [![pypi](https://img.shields.io/pypi/v/linkify-it-py)](https://pypi.org/project/linkify-it-py/)
+[![Anaconda-Server Badge](https://anaconda.org/conda-forge/linkify-it-py/badges/version.svg)](https://anaconda.org/conda-forge/linkify-it-py)
 [![codecov](https://codecov.io/gh/tsutsu3/linkify-it-py/branch/main/graph/badge.svg)](https://codecov.io/gh/tsutsu3/linkify-it-py)
 [![Maintainability](https://api.codeclimate.com/v1/badges/6341fd3ec5f05fde392f/maintainability)](https://codeclimate.com/github/tsutsu3/linkify-it-py/maintainability)
 
@@ -25,6 +26,12 @@ Why it's awesome:
 pip install linkify-it-py
 ```
 
+or
+
+```bash
+conda install -c conda-forge linkify-it-py
+```
+
 ## Usage examples
 
 ### Example 1. Simple use
@@ -82,28 +89,28 @@ print(linkify.match("Site tamanegi.onion!"))
 ### Example 3. Add twitter mentions handler
 
 ```python
-from linkify import LinkfiyIt
+from linkify_it import LinkifyIt
 
 
-linkifyit = LinkifyIt()
+linkify = LinkifyIt()
 
-def validate(self, text, pos):
+def validate(obj, text, pos):
     tail = text[pos:]
 
-    if not self.re.get("twitter"):
-        self.re["twitter"] = re.compile(
-            "^([a-zA-Z0-9_]){1,15}(?!_)(?=$|" + self.re["src_ZPCc"] + ")"
+    if not obj.re.get("twitter"):
+        obj.re["twitter"] = re.compile(
+            "^([a-zA-Z0-9_]){1,15}(?!_)(?=$|" + obj.re["src_ZPCc"] + ")"
         )
-    if self.re["twitter"].search(tail):
+    if obj.re["twitter"].search(tail):
         if pos > 2 and tail[pos - 2] == "@":
             return False
-        return len(self.re["twitter"].search(tail).group())
+        return len(obj.re["twitter"].search(tail).group())
     return 0
 
-def normalize(self, m):
-    m.url = "https://twitter.com/" + re.sub(r"^@", "", m.url)
+def normalize(obj, match):
+    match.url = "https://twitter.com/" + re.sub(r"^@", "", match.url)
 
-linkifyit.add("@", {"validate": validate, "normalize": normalize})
+linkify.add("@", {"validate": validate, "normalize": normalize})
 ```
 
 
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 @@ class LinkifyIt:
 
     def _create_normalizer(self):
         def func(match):
-            self._normalize(match)
+            self.normalize(match)
 
         return func
 
@@ -590,11 +590,11 @@ class LinkifyIt:
         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


Test patch:
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