Referring to `page.document` breaks non-HTML file
See original GitHub issueThis is a quick bug report.
Reproduction procedure
- Create
_config.ts
as:
import lume from "lume/mod.ts";
const site = lume();
site.loadAssets([".css"]);
site.addEventListener(
"afterRender",
() => site.pages.forEach((page) => page.document),
);
export default site;
- Create
test.css
as:
h1 {color: red}
- Execute
lume
to get_site/test.css
as:
<!DOCTYPE html>
<html><head></head><body>h1 {color: red}
</body></html>
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Link to Non-HTML File - Equalize Digital
A non-HTML document is any document that has been created without using HTML, such as PDFs, Microsoft Office or Open Office documents, and...
Read more >page-break-before - CSS: Cascading Style Sheets | MDN
The page-break-before CSS property adjusts page breaks before the current element.
Read more >rendering page breaks in word with html - Stack Overflow
Try making a Word document with a page break - i.e. two pages. Save it as HTML and check the generated code for...
Read more >Insert a page break - Microsoft Support
Go to Insert > Page Break. Insert a page break. Tip: If Word puts a new page in your document unexpectedly, it might...
Read more >CSS Page-break-after Property - W3Schools
The page-break-after property adds a page-break after a specified element. Tip: The properties: page-break-before, page-break-after and page-break-inside help ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I understand. A page represents a complete html page of the site, so I don’t think this is a common casuistry. Anyway, with the latest change, only pages with
.html
or.htm
extensions are parsed, so if anyone want to provide a fragment of a document, a different extension can be used, so the document won’t be modified.I’m closing this. Thanks!!
Nope, I don’t have particular case for document without html/body tags. Someone want to provide a fragment of document for embedding purpose? IDK, it’s just imagination. I just worried about modifying something just by referencing. Maybe I’m a big worrier. If you feel it okay, then go ahead!