Commit 6f272fcd authored by Deimos's avatar Deimos

Revert "Build HTML Tidy, validate homepage HTML in tests"

This reverts commit cb7be838.

HTML Tidy seems to have various gaps in its validation that we've found
already, including one that's pretty much a deal-breaker for Tildes's
HTML: it doesn't think that <menu> is a valid parent for <li>.

We're looking at alternative validators still.
parent cb7be838
{% set tidy_version = '5.7.28' %}
unpack-tidy:
archive.extracted:
- name: /tmp/tidy-{{ tidy_version }}
- source:
- https://github.com/htacg/tidy-html5/archive/{{ tidy_version }}.tar.gz
- source_hash: sha256=5caa2c769204f506e24ea4986a45abe23f71d14f0fe968314f20065f342ffdba
- unless: /usr/local/bin/tidy --version | grep 'version {{ tidy_version }}'
- options: --strip-components=1
- enforce_toplevel: False
install-tidy:
pkg.installed:
- pkgs:
- build-essential
cmd.run:
- cwd: /tmp/tidy-{{ tidy_version }}/build/cmake
- names:
- cmake ../.. -DCMAKE_BUILD_TYPE=Release
- make
- make install
- ldconfig
- onchanges:
- archive: unpack-tidy
......@@ -30,7 +30,6 @@ base:
- development
- prometheus
- nodejs
- tidy
'prod':
- nginx.shortener-config
- nginx.static-sites-config
......
......@@ -6,6 +6,5 @@ prospector
pyramid-debugtoolbar
pytest
pytest-mock
pytidylib
testing.redis
webtest
......@@ -81,7 +81,6 @@ pytest-mock==3.2.0
pytest==6.0.0
python-dateutil==2.8.1
python-editor==1.0.4 # via alembic
pytidylib==0.3.2
pyyaml==5.3.1
qrcode==6.1
redis==3.5.3
......
# Copyright (c) 2020 Tildes contributors <[email protected]>
# SPDX-License-Identifier: AGPL-3.0-or-later
from tidylib import tidy_document
def test_homepage_tidy_loggedout(webtest_loggedout):
"""Validate HTML5 using Tidy on the Tildes homepage, logged out."""
homepage = webtest_loggedout.get("/")
_document, errors = tidy_document(homepage.body)
assert not errors
def test_homepage_tidy_loggedin(webtest):
"""Validate HTML5 using Tidy on the Tildes homepage, logged in."""
homepage = webtest.get("/")
_document, errors = tidy_document(homepage.body)
assert not errors
......@@ -130,7 +130,7 @@
<li class="site-footer-link"><a href="https://blog.tildes.net">Blog</a></li>
<li class="site-footer-link"><a href="https://docs.tildes.net/contact">Contact</a></li>
<li class="site-footer-link"><a href="https://gitlab.com/tildes/tildes">Source code</a></li>
<li class="site-footer-link"><a href="https://gitlab.com/tildes/tildes/issues?label_name%5B%5D=Feature+Request&amp;label_name%5B%5D=Stage%3A%3AAccepted&amp;scope=all&amp;sort=priority&amp;state=opened">Planned features</a> / <a href="https://gitlab.com/tildes/tildes/issues">All issues</a></li>
<li class="site-footer-link"><a href="https://gitlab.com/tildes/tildes/issues?label_name[]=Feature+Request&label_name[]=Stage%3A%3AAccepted&scope=all&sort=priority&state=opened">Planned features</a> / <a href="https://gitlab.com/tildes/tildes/issues">All issues</a></li>
<li class="site-footer-link"><a href="https://docs.tildes.net/policies/privacy-policy">Privacy policy</a></li>
<li class="site-footer-link"><a href="https://docs.tildes.net/policies/terms-of-use">Terms of use</a></li>
</ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment