pax_global_header00006660000000000000000000000064141705712400014513gustar00rootroot0000000000000052 comment=d9896c4aa5dea50a5e2587a991b092dd1a847d07 html-sanitizer-1.9.3/000077500000000000000000000000001417057124000144775ustar00rootroot00000000000000html-sanitizer-1.9.3/.github/000077500000000000000000000000001417057124000160375ustar00rootroot00000000000000html-sanitizer-1.9.3/.github/workflows/000077500000000000000000000000001417057124000200745ustar00rootroot00000000000000html-sanitizer-1.9.3/.github/workflows/test.yml000066400000000000000000000020521417057124000215750ustar00rootroot00000000000000name: 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/.gitignore000066400000000000000000000001411417057124000164630ustar00rootroot00000000000000*.py? *~ *.sw? .DS_Store ._* /MANIFEST _build build dist .eggs *.egg-info .tox .coverage htmlcov html-sanitizer-1.9.3/CHANGELOG.rst000066400000000000000000000121311417057124000165160ustar00rootroot00000000000000========== 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.cfg000066400000000000000000000021311417057124000163150ustar00rootroot00000000000000[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.py000077500000000000000000000000761417057124000162170ustar00rootroot00000000000000#!/usr/bin/env python3 from setuptools import setup setup() html-sanitizer-1.9.3/tox.ini000066400000000000000000000006751417057124000160220ustar00rootroot00000000000000[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