WeasyPrint
WeasyPrint copied to clipboard
Improve PDF/UA support
Fix #2363.
This branch is ready to be tested.
Some improvements can/will be made, before merging or in a future issue:
- ~warn users when they don’t set a document language or title~ (done),
- ~warn users when they forgot an
altattribute on images~ (done), dlelements are poorly tagged, there’s no 1:1 match between HTML and PDF structures,- PAC complains about some useless spans (just warnings),
- ~hidden titles break levels consistency~ (that’s probably what we want).
Some bugs unrelated to this PR can affect PDF/UA validity, we’ll create new issues for them:
- empty anonymous blocks are created sometimes, for example when list items are displayed as inline,
- a
paintoperation is done when drawing all SVG tags, even the ones with nothing to draw.
I tested the PR on our templates and with @alvarogf97 changes it seems to work almost perfectly (our templates are not perfect either :)
#2482 has been opened to track other issues that are not fixed by this pull request. Time to merge! 🎉