Closed benoit74 closed 5 months ago
Oh no, this is fixed by 2e40adf
(#154), isn't it?
Oh no, this is fixed by 2e40adf (#154), isn't it?
Seems so. At least with #154 as I've rewrite your commit. But yes, it is "fixed".
Let's keep it open until we have merged and made a new run to confirm it.
Still fail in CSS rewriting https://farm.openzim.org/pipeline/dbd1565e-d5b9-4642-8788-f472bb33c147/debug
This is caused by this page (https://thalesdocs.com/sta/agents/freeradius/download-keys/index.html) which contain invalid inline style
as:
<p><img 1px alt="Authentication Agent Settings" id="c0c0c0;" solid src="[../../../images/operator/authentication-agent-settings.png](view-source:https://thalesdocs.com/sta/images/operator/authentication-agent-settings.png)" style=""border:"></p>
@mgautierfr What do you intend to do in such a situation?
Pr #175 fixes this by simply returning the original css if we cannot parse it.
For reference, using the "1000 page warc of Thales", the errors are:
Error rewriting CSS
"border:
Error rewriting CSS
"border:
Error rewriting CSS
border: solid 1px #c0c0c0; width= 100%
Error rewriting CSS
border: solid 1px #c0c0c0; width = 100%
Error rewriting CSS
"width:
Error rewriting CSS
width: 100%; cellspacing=
Error rewriting CSS
width: 100%; cellspacing=
Error rewriting CSS
"border-style:
Error rewriting CSS
"border:
Error rewriting CSS
"border-left-style:
Error rewriting CSS
border: solid 1px #c0c0c0; width= 100%
Error rewriting CSS
border: solid 1px #c0c0c0; width = 100%
Error rewriting CSS
"border:
Error rewriting CSS
"border:
Error rewriting CSS
border-left-style: solid;border-left-width: 1px;border-left-color: #c0c0c0;border-right-style: solid;border-right-width: 1px;border-right-color: #c0c0c0;border-top-style: solid;border-top-width: 1px;border-top-color: #c0c0c0;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #c0c0c0;w
Error rewriting CSS
border: solid 1px #c0c0c0; width= 100%
Error rewriting CSS
border: solid 1px #c0c0c0; width = 100%
Error rewriting CSS
width: 100%; cellspacing=
Error rewriting CSS
width: 100%; cellspacing=
Error rewriting CSS
border: solid 1px #c0c0c0; width= 100%
Error rewriting CSS
border: solid 1px #c0c0c0; width = 100%
Do we rewrite anything else than url()? Do we really something sophisticated like a css parser? zimwriterfs approach might be good enough? As fallback?
Hum. I don't like regex rewrite. There is a lot of tricky thing in escaped chars that can fool us. But as a fallback for invalid css, it may be ok, if regex rewrite break on broken css, we can say it is the fault of css, not the rewriter.
Fixed by #175
We have an error in zimit2 for https://farm.openzim.org/pipeline/2119ed82-41aa-4561-a359-8e75968b445c/debug
Looks like we have one more
# pyright: ignore
which should not be there in my last PR (url
can indeed by None and it is an issue).