pax_global_header 0000666 0000000 0000000 00000000064 14170571240 0014513 g ustar 00root root 0000000 0000000 52 comment=d9896c4aa5dea50a5e2587a991b092dd1a847d07
html-sanitizer-1.9.3/ 0000775 0000000 0000000 00000000000 14170571240 0014477 5 ustar 00root root 0000000 0000000 html-sanitizer-1.9.3/.github/ 0000775 0000000 0000000 00000000000 14170571240 0016037 5 ustar 00root root 0000000 0000000 html-sanitizer-1.9.3/.github/workflows/ 0000775 0000000 0000000 00000000000 14170571240 0020074 5 ustar 00root root 0000000 0000000 html-sanitizer-1.9.3/.github/workflows/test.yml 0000664 0000000 0000000 00000002052 14170571240 0021575 0 ustar 00root root 0000000 0000000 name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install beautifulsoup4 lxml
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run tests
run: |
python -m unittest discover -v
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Run lint
run: tox -e style
html-sanitizer-1.9.3/.gitignore 0000664 0000000 0000000 00000000141 14170571240 0016463 0 ustar 00root root 0000000 0000000 *.py?
*~
*.sw?
.DS_Store
._*
/MANIFEST
_build
build
dist
.eggs
*.egg-info
.tox
.coverage
htmlcov
html-sanitizer-1.9.3/CHANGELOG.rst 0000664 0000000 0000000 00000012131 14170571240 0016516 0 ustar 00root root 0000000 0000000 ==========
Change log
==========
`Next version`_
===============
- Dropped support for Python 2.7 and 3.5.
- Raised the minimum lxml version to the current 4.6.3.
- Switched from Travis CI to GitHub actions. Added Python 3.9 to the CI
matrix.
- Renamed the main branch to main.
- Switched to a declarative setup.
- Fixed a whitespace dependency in the testsuite.
`1.9`_ (2020-01-20)
===================
- Added Python 3.8 to the CI matrix.
- Be able to keep the ``bar", "foobar")],
sanitizer=Sanitizer(
{
"tags": {"impossible tag"},
"attributes": {},
"empty": set(),
"separate": set(),
}
),
)
# allow style tag but no style attribute
self.run_tests(
[
(
"foobar",
"foobar",
),
('
bla
', "bla
"),
],
sanitizer=Sanitizer(
{
"tags": {"h2", "style"},
"attributes": {},
"empty": set(),
"separate": set(),
}
),
)
# allow style tag and style attribute
self.run_tests(
[
(
"foobar",
"foobar",
),
(
'bla
',
'bla
',
),
],
sanitizer=Sanitizer(
{
"tags": {"h2", "style"},
"attributes": {"h2": {"style"}},
"empty": set(),
"separate": set(),
}
),
)
def test_billion_laughs(self):
source = """\
]>
&lol9;
"""
external_entities = """\
]>&xxe;
"""
self.run_tests(
[
(source, " ]> &lol9; "),
(external_entities, " ]>&xxe; "),
],
strip=True,
)
def test_data_attributes(self):
sanitizer = Sanitizer(
{
"tags": ["span"],
"empty": (),
"separate": (),
"attributes": {"span": {"data-title"}},
}
)
entries = (
(
'Content',
'Content',
),
(
'Content',
'Content',
),
)
self.run_tests(entries, sanitizer=sanitizer)
html-sanitizer-1.9.3/setup.cfg 0000664 0000000 0000000 00000002131 14170571240 0016315 0 ustar 00root root 0000000 0000000 [metadata]
name = html_sanitizer
version = attr: html_sanitizer.__version__
description = HTML sanitizer
long_description = file: README.rst
long_description_content_type = text/x-rst
url = https://github.com/matthiask/html-sanitizer/
author = Matthias Kestenholz
author_email = mk@feinheit.ch
license = BSD-3-Clause
license_file = LICENSE
platforms = OS Independent
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Web Environment
Framework :: Django
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Software Development
[options]
packages = find:
install_requires =
beautifulsoup4
lxml>=4.6.5
python_requires = >=3.6
include_package_data = True
[flake8]
exclude = venv,build,docs,.eggs,.tox
max-line-length = 88
[isort]
profile = black
combine_as_imports = True
lines_after_imports = 2
[coverage:run]
branch = True
include =
*html_sanitizer*
omit =
*migrations*
*tests*
*.tox*
html-sanitizer-1.9.3/setup.py 0000775 0000000 0000000 00000000076 14170571240 0016217 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python3
from setuptools import setup
setup()
html-sanitizer-1.9.3/tox.ini 0000664 0000000 0000000 00000000675 14170571240 0016022 0 ustar 00root root 0000000 0000000 [tox]
envlist = style,tests
[testenv]
basepython = python3
[testenv:style]
deps =
black
flake8
isort
changedir = {toxinidir}
commands =
isort html_sanitizer setup.py
black html_sanitizer setup.py
flake8 .
skip_install = true
[testenv:tests]
deps =
wheel
lxml
beautifulsoup4
coverage
changedir = {toxinidir}
skip_install = true
commands =
coverage run -m unittest discover -v
coverage report -m