diff --git a/bleach/linkifier.py b/bleach/linkifier.py
index 5d815f8..95baba1 100644
--- a/bleach/linkifier.py
+++ b/bleach/linkifier.py
@@ -85,7 +85,7 @@ class Linker(object):
 
     """
     def __init__(self, callbacks=DEFAULT_CALLBACKS, skip_tags=None, parse_email=False,
-                 url_re=URL_RE, email_re=EMAIL_RE):
+                 url_re=URL_RE, email_re=EMAIL_RE, recognized_tags=html5lib_shim.HTML_TAGS):
         """Creates a Linker instance
 
         :arg list callbacks: list of callbacks to run when adjusting tag attributes;
@@ -101,6 +101,9 @@ class Linker(object):
 
         :arg re email_re: email matching regex
 
+        :arg list-of-strings recognized_tags: the list of tags that linkify knows about;
+            everything else gets escaped
+
         :returns: linkified text as unicode
 
         """
@@ -113,7 +116,7 @@ class Linker(object):
         # Create a parser/tokenizer that allows all HTML tags and escapes
         # anything not in that list.
         self.parser = html5lib_shim.BleachHTMLParser(
-            tags=html5lib_shim.HTML_TAGS,
+            tags=recognized_tags,
             strip=False,
             consume_entities=True,
             namespaceHTMLElements=False,
diff --git a/docs/linkify.rst b/docs/linkify.rst
index d60e17b..b8e7884 100644
--- a/docs/linkify.rst
+++ b/docs/linkify.rst
@@ -12,13 +12,14 @@ For example, you could pass in text and have all URL things converted into
 HTML links.
 
 It works by parsing the text as HTML and building a document tree. In this
-way, it's guaranteed never to do weird things to URLs in attribute values,
-can modify the value of attributes on ``<a>`` tags and can even do things
-like skip ``<pre>`` sections.
+way, you're guaranteed to get valid HTML back without weird things like
+having URLs in tag attributes getting linkified.
 
-If you plan to sanitize/clean the text and linkify it, you should do that
-in a single pass using :ref:`LinkifyFilter <linkify-LinkifyFilter>`. This
-is faster and it'll use the list of allowed tags from clean.
+.. note::
+
+   If you plan to sanitize/clean the text and linkify it, you should do that
+   in a single pass using :ref:`LinkifyFilter <linkify-LinkifyFilter>`. This
+   is faster and it'll use the list of allowed tags from clean.
 
 .. note::
 
@@ -297,8 +298,8 @@ writing callbacks that may need to behave differently if the protocol is
 Using ``bleach.linkifier.Linker``
 =================================
 
-If you're linking a lot of text and passing the same argument values or you want
-more configurability, consider using a :py:class:`bleach.linkifier.Linker`
+If you're linking a lot of text and passing the same argument values or you
+need more configurability, consider using a :py:class:`bleach.linkifier.Linker`
 instance.
 
 .. doctest::
@@ -325,8 +326,8 @@ Using ``bleach.linkifier.LinkifyFilter``
 the ``bleach.linkifier.LinkifyFilter`` when walking the tree and serializing it
 back into text.
 
-You can use this filter wherever you can use an html5lib Filter. For example, you
-could use it with ``bleach.Cleaner`` to clean and linkify in one step.
+You can use this filter wherever you can use an html5lib Filter. This lets you
+use it with ``bleach.Cleaner`` to clean and linkify in one step.
 
 For example, using all the defaults:
 

linkify is escaping valid HTML tags
Originally noticed here in relation to the `<abbr>` tag: https://github.com/mozilla/bleach/issues/400

linkify is now using a list of valid HTML tags that is largely built up from constants in html5lib, here: https://github.com/mozilla/bleach/blob/master/bleach/html5lib_shim.py#L49

However, these constants don't seem to make up a complete list of valid tags&mdash;in addition to `<abbr>` (which is now being appended to the list by Bleach), there are also multiple other tags missing, including `del`, `ins`, `sub`, `sup`, and `span`.

It would probably be best to replace this combination of html5lib constants with a full list of valid tags. I can do a PR for this.
diff --git a/tests/test_linkify.py b/tests/test_linkify.py
index eeea3e3..d29a5c8 100644
--- a/tests/test_linkify.py
+++ b/tests/test_linkify.py
@@ -625,6 +625,23 @@ def test_email_re_arg():
     )
 
 
+def test_recognized_tags_arg():
+    """Verifies that recognized_tags works"""
+    # The html parser doesn't recognize "sarcasm" as a tag, so it escapes it
+    linker = Linker(recognized_tags=['p'])
+    assert (
+        linker.linkify('<p>http://example.com/</p><sarcasm>') ==
+        '<p><a href="http://example.com/" rel="nofollow">http://example.com/</a></p>&lt;sarcasm&gt;'  # noqa
+    )
+
+    # The html parser recognizes "sarcasm" as a tag and fixes it
+    linker = Linker(recognized_tags=['p', 'sarcasm'])
+    assert (
+        linker.linkify('<p>http://example.com/</p><sarcasm>') ==
+        '<p><a href="http://example.com/" rel="nofollow">http://example.com/</a></p><sarcasm></sarcasm>'  # noqa
+    )
+
+
 def test_linkify_idempotent():
     dirty = '<span>invalid & </span> < extra http://link.com<em>'
     assert linkify(linkify(dirty)) == linkify(dirty)

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-wholenodeid
apt-get update apt-get install -y gcc
3.9
requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.16
babel==2.17.0
backports.tarfile==1.2.0
-e git+https://github.com/mozilla/bleach.git@26fb1da0472ac76a37e0f5eb91f4017f29350a46#egg=bleach
cachetools==5.5.2
certifi==2025.1.31
cffi==1.17.1
chardet==5.2.0
charset-normalizer==3.4.1
colorama==0.4.6
cryptography==44.0.2
distlib==0.3.9
docutils==0.21.2
exceptiongroup==1.2.2
filelock==3.18.0
flake8==7.2.0
id==1.5.0
idna==3.10
imagesize==1.4.1
importlib_metadata==8.6.1
iniconfig==2.1.0
jaraco.classes==3.4.0
jaraco.context==6.0.1
jaraco.functools==4.1.0
jeepney==0.9.0
Jinja2==3.1.6
keyring==25.6.0
markdown-it-py==3.0.0
MarkupSafe==3.0.2
mccabe==0.7.0
mdurl==0.1.2
more-itertools==10.6.0
nh3==0.2.21
packaging==24.2
platformdirs==4.3.7
pluggy==1.5.0
pycodestyle==2.13.0
pycparser==2.22
pyflakes==3.3.1
Pygments==2.19.1
pyproject-api==1.9.0
pytest==8.3.5
pytest-wholenodeid==0.2
readme_renderer==44.0
requests==2.32.3
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==14.0.0
SecretStorage==3.3.3
six==1.17.0
snowballstemmer==2.2.0
Sphinx==7.4.7
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
tomli==2.2.1
tox==4.25.0
twine==6.1.0
typing_extensions==4.13.0
urllib3==2.3.0
virtualenv==20.29.3
webencodings==0.5.1
zipp==3.21.0

name: bleach
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.16
      - babel==2.17.0
      - backports-tarfile==1.2.0
      - cachetools==5.5.2
      - certifi==2025.1.31
      - cffi==1.17.1
      - chardet==5.2.0
      - charset-normalizer==3.4.1
      - colorama==0.4.6
      - cryptography==44.0.2
      - distlib==0.3.9
      - docutils==0.21.2
      - exceptiongroup==1.2.2
      - filelock==3.18.0
      - flake8==7.2.0
      - id==1.5.0
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - jaraco-classes==3.4.0
      - jaraco-context==6.0.1
      - jaraco-functools==4.1.0
      - jeepney==0.9.0
      - jinja2==3.1.6
      - keyring==25.6.0
      - markdown-it-py==3.0.0
      - markupsafe==3.0.2
      - mccabe==0.7.0
      - mdurl==0.1.2
      - more-itertools==10.6.0
      - nh3==0.2.21
      - packaging==24.2
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pycparser==2.22
      - pyflakes==3.3.1
      - pygments==2.19.1
      - pyproject-api==1.9.0
      - pytest==8.3.5
      - pytest-wholenodeid==0.2
      - readme-renderer==44.0
      - requests==2.32.3
      - requests-toolbelt==1.0.0
      - rfc3986==2.0.0
      - rich==14.0.0
      - secretstorage==3.3.3
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==7.4.7
      - sphinxcontrib-applehelp==2.0.0
      - sphinxcontrib-devhelp==2.0.0
      - sphinxcontrib-htmlhelp==2.1.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==2.0.0
      - sphinxcontrib-serializinghtml==2.0.0
      - tomli==2.2.1
      - tox==4.25.0
      - twine==6.1.0
      - typing-extensions==4.13.0
      - urllib3==2.3.0
      - virtualenv==20.29.3
      - webencodings==0.5.1
      - zipp==3.21.0
prefix: /opt/conda/envs/bleach

tests/test_linkify.py::test_recognized_tags_arg
tests/test_linkify.py::test_empty tests/test_linkify.py::test_simple_link tests/test_linkify.py::test_trailing_slash tests/test_linkify.py::test_mangle_link tests/test_linkify.py::test_mangle_text tests/test_linkify.py::test_email_link[a tests/test_linkify.py::test_email_link[aussie tests/test_linkify.py::test_email_link[email tests/test_linkify.py::test_email_link[<br>jinkyun@example.com-True-<br><a tests/test_linkify.py::test_email_link[mailto tests/test_linkify.py::test_email_link["\\\n"@opa.ru-True-"\\\n"@opa.ru] tests/test_linkify.py::test_email_link_escaping["james"@example.com-<a tests/test_linkify.py::test_email_link_escaping["j'ames"@example.com-<a tests/test_linkify.py::test_email_link_escaping["ja>mes"@example.com-<a tests/test_linkify.py::test_prevent_links[callback0-a tests/test_linkify.py::test_prevent_links[callback1-a tests/test_linkify.py::test_prevent_links[callback2-a tests/test_linkify.py::test_prevent_links[callback3-a tests/test_linkify.py::test_prevent_links[callback4-a tests/test_linkify.py::test_prevent_links[callback5-a tests/test_linkify.py::test_set_attrs tests/test_linkify.py::test_only_proto_links tests/test_linkify.py::test_stop_email tests/test_linkify.py::test_tlds[example.com-<a tests/test_linkify.py::test_tlds[example.co-<a tests/test_linkify.py::test_tlds[example.co.uk-<a tests/test_linkify.py::test_tlds[example.edu-<a tests/test_linkify.py::test_tlds[example.xxx-<a tests/test_linkify.py::test_tlds[bit.ly/fun-<a tests/test_linkify.py::test_tlds[example.yyy-example.yyy] tests/test_linkify.py::test_tlds[brie-brie] tests/test_linkify.py::test_escaping tests/test_linkify.py::test_nofollow_off tests/test_linkify.py::test_link_in_html tests/test_linkify.py::test_links_https tests/test_linkify.py::test_add_rel_nofollow tests/test_linkify.py::test_url_with_path tests/test_linkify.py::test_link_ftp tests/test_linkify.py::test_link_query tests/test_linkify.py::test_link_fragment tests/test_linkify.py::test_link_entities tests/test_linkify.py::test_escaped_html tests/test_linkify.py::test_link_http_complete tests/test_linkify.py::test_non_url tests/test_linkify.py::test_javascript_url tests/test_linkify.py::test_unsafe_url tests/test_linkify.py::test_skip_tags tests/test_linkify.py::test_libgl tests/test_linkify.py::test_end_of_sentence[example.com-.] tests/test_linkify.py::test_end_of_sentence[example.com-...] tests/test_linkify.py::test_end_of_sentence[ex.com/foo-.] tests/test_linkify.py::test_end_of_sentence[ex.com/foo-....] tests/test_linkify.py::test_end_of_clause tests/test_linkify.py::test_sarcasm tests/test_linkify.py::test_wrapping_parentheses[(example.com)-expected_data0] tests/test_linkify.py::test_wrapping_parentheses[(example.com/)-expected_data1] tests/test_linkify.py::test_wrapping_parentheses[(example.com/foo)-expected_data2] tests/test_linkify.py::test_wrapping_parentheses[(((example.com/))))-expected_data3] tests/test_linkify.py::test_wrapping_parentheses[example.com/))-expected_data4] tests/test_linkify.py::test_wrapping_parentheses[(foo tests/test_linkify.py::test_wrapping_parentheses[http://en.wikipedia.org/wiki/Test_(assessment)-expected_data7] tests/test_linkify.py::test_wrapping_parentheses[(http://en.wikipedia.org/wiki/Test_(assessment))-expected_data8] tests/test_linkify.py::test_wrapping_parentheses[((http://en.wikipedia.org/wiki/Test_(assessment))-expected_data9] tests/test_linkify.py::test_wrapping_parentheses[(http://en.wikipedia.org/wiki/Test_(assessment)))-expected_data10] tests/test_linkify.py::test_wrapping_parentheses[(http://en.wikipedia.org/wiki/)Test_(assessment-expected_data11] tests/test_linkify.py::test_wrapping_parentheses[hello tests/test_linkify.py::test_parentheses_with_removing tests/test_linkify.py::test_ports[http://foo.com:8000-expected_data0] tests/test_linkify.py::test_ports[http://foo.com:8000/-expected_data1] tests/test_linkify.py::test_ports[http://bar.com:xkcd-expected_data2] tests/test_linkify.py::test_ports[http://foo.com:81/bar-expected_data3] tests/test_linkify.py::test_ports[http://foo.com:-expected_data4] tests/test_linkify.py::test_ports[http://foo.com:\u0663\u0669/-expected_data5] tests/test_linkify.py::test_ports[http://foo.com:\U0001d7e0\U0001d7d8/-expected_data6] tests/test_linkify.py::test_ignore_bad_protocols tests/test_linkify.py::test_link_emails_and_urls tests/test_linkify.py::test_links_case_insensitive tests/test_linkify.py::test_elements_inside_links tests/test_linkify.py::test_drop_link_tags tests/test_linkify.py::test_naughty_unescaping[&lt;br&gt;-&lt;br&gt;] tests/test_linkify.py::test_naughty_unescaping[&lt;br&gt; tests/test_linkify.py::test_hang tests/test_linkify.py::test_hyphen_in_mail tests/test_linkify.py::test_url_re_arg tests/test_linkify.py::test_email_re_arg tests/test_linkify.py::test_linkify_idempotent tests/test_linkify.py::TestLinkify::test_no_href_links tests/test_linkify.py::TestLinkify::test_rel_already_there tests/test_linkify.py::TestLinkify::test_only_text_is_linkified tests/test_linkify.py::test_linkify_filter[abc-abc] tests/test_linkify.py::test_linkify_filter[example.com-<a tests/test_linkify.py::test_linkify_filter[http://example.com?b=1&c=2-<a tests/test_linkify.py::test_linkify_filter[link:
bleach/linkifier.py docs/linkify.rst
bleach/linkifier.py docs/linkify.rst