Skip to content

Commit

Permalink
Fix reference warnings in docs (#660) (#665)
Browse files Browse the repository at this point in the history
  • Loading branch information
willkg committed May 31, 2022
1 parent 4f951d3 commit 24c21bb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
12 changes: 6 additions & 6 deletions bleach/linkifier.py
Expand Up @@ -126,11 +126,11 @@ def __init__(
:arg bool parse_email: whether or not to linkify email addresses
:arg re url_re: url matching regex
:arg url_re: url matching regex
:arg re email_re: email matching regex
:arg email_re: email matching regex
:arg list-of-strings recognized_tags: the list of tags that linkify knows about;
:arg list recognized_tags: the list of tags that linkify knows about;
everything else gets escaped
:returns: linkified text as unicode
Expand Down Expand Up @@ -213,7 +213,7 @@ def __init__(
):
"""Creates a LinkifyFilter instance
:arg TreeWalker source: stream
:arg source: stream as an html5lib TreeWalker
:arg list callbacks: list of callbacks to run when adjusting tag attributes;
defaults to ``bleach.linkifier.DEFAULT_CALLBACKS``
Expand All @@ -224,9 +224,9 @@ def __init__(
:arg bool parse_email: whether or not to linkify email addresses
:arg re url_re: url matching regex
:arg url_re: url matching regex
:arg re email_re: email matching regex
:arg email_re: email matching regex
"""
super().__init__(source)
Expand Down
2 changes: 1 addition & 1 deletion bleach/sanitizer.py
Expand Up @@ -247,7 +247,7 @@ def __init__(
):
"""Creates a BleachSanitizerFilter instance
:arg Treewalker source: stream
:arg source: html5lib TreeWalker stream as an html5lib TreeWalker
:arg list allowed_elements: allowed list of tags; defaults to
``bleach.sanitizer.ALLOWED_TAGS``
Expand Down
3 changes: 1 addition & 2 deletions docs/clean.rst
Expand Up @@ -330,7 +330,6 @@ Defaults are stored in ``bleach.css_sanitizer.ALLOWED_CSS_PROPERTIES`` and
.. autodata:: bleach.css_sanitizer.ALLOWED_SVG_PROPERTIES

.. autoclass:: bleach.css_sanitizer.CSSSanitizer
:autodoc_preserve_defaults:

.. versionadded:: 5.0

Expand All @@ -352,7 +351,7 @@ html5lib Filters (``filters``)

Bleach sanitizing is implemented as an html5lib filter. The consequence of this
is that we can pass the streamed content through additional specified filters
after the :py:class:`bleach.sanitizer.BleachSanitizingFilter` filter has run.
after the :py:class:`bleach.sanitizer.BleachSanitizerFilter` filter has run.

This lets you add data, drop data and change data as it is being serialized back
to a unicode.
Expand Down
3 changes: 3 additions & 0 deletions docs/conf.py
Expand Up @@ -90,6 +90,9 @@

# Display the class docstring and __init__ docstring concatenated
autoclass_content = 'both'
# Reduce complexity of function signatures by not evaluating the argument
# default values.
# NOTE(willkg) This is experimental in Sphinx 4.
autodoc_preserve_defaults = True


Expand Down
8 changes: 4 additions & 4 deletions docs/goals.rst
Expand Up @@ -157,7 +157,7 @@ Bleach will not protect against CSS-based XSS vectors that only worked
in legacy IE, Opera, or Netscape/Mozilla/Firefox browsers. For
example, it will not remove ``expression`` or ``url`` functions in CSS
component values in style elements or attributes and `other vectors
https://html5sec.org/#css`_.
<https://html5sec.org/#css>`_.


Protect against privacy, cross site, or HTTP leaks
Expand All @@ -169,9 +169,9 @@ it will not remove CSS Media Queries or tracking pixels.

See also:

* `browser leaks https://browserleaks.com/`_
* `HTTP leaks https://github.com/cure53/HTTPLeaks`_
* `XS leaks https://xsleaks.dev/`_
* `browser leaks <https://browserleaks.com/>`__
* `HTTP leaks <https://github.com/cure53/HTTPLeaks>`__
* `XS leaks <https://xsleaks.dev/>`__

Bleach vs html5lib
==================
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -39,7 +39,7 @@ def get_version():
"pytest==7.1.1",
"flake8==4.0.1",
"tox==3.24.5",
"sphinx==4.3.2",
"Sphinx==4.3.2",
"twine==4.0.0",
"wheel==0.37.1",
"hashin==0.17.0",
Expand Down

0 comments on commit 24c21bb

Please sign in to comment.