-
Notifications
You must be signed in to change notification settings - Fork 391
don't loose DOCTYPE header in embed resource processing #12455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Good fix! But do we understand where the regression comes from? |
I tried to explain this above. Let me try to reformulate. When there is no DOCTYPE in the document, browsers use specific modes that don't use the same browser's default CSS. The link I shared above explains that. The problem is caused by a difference in the browser's default CSS. I can't point you to the rule exactly. However, we were wrongly removing the DOCTYPE while doing embedding, so it seems to be the cause of the breakage in Quarto, even thought I did not see the browser rule that changed. Quirks mode showed other warning in Browser console, so we definitely don't want that. |
|
Sorry. What I meant is that I thought this was a regression given #12295 (comment), and I would like to understand what caused the regression. |
|
Did you see #12295 (comment) ? The commit that cause the problem is 19cf9ef where Following the change the DOM is parsed quarto-cli/src/core/pandoc/self-contained.ts Lines 50 to 51 in 19cf9ef
and inserted in raw block after esbuild run quarto-cli/src/core/pandoc/self-contained.ts Lines 52 to 57 in 19cf9ef
Before that it was directly the text file content put in raw block (which includes DOCTYPE line) quarto-cli/src/core/pandoc/self-contained.ts Lines 25 to 29 in 92cad44
But parsing the DOM and only use I feel you may have understood this already, and I missing the point of what you want to understand... 🤔 am I ? |
|
This clarifies it, thank you! It's the roundtrip through the DOM parser specifically, and not |
Yes exactly ! A very good summary 😄 thank you ! |
fix #12295
If a HTML file does not have DOCTYPE, then the browser are using Quirks mode and not applying standard HTML5 CSS. Hence the problem seen in #12295