question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Referring to `page.document` breaks non-HTML file

See original GitHub issue

This is a quick bug report.

Reproduction procedure

  1. 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;
  1. Create test.css as:
h1 {color: red}
  1. Execute lume to get _site/test.css as:
<!DOCTYPE html>
<html><head></head><body>h1 {color: red}
</body></html>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
oscaroterocommented, Jan 19, 2022

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!!

0reactions
aiottercommented, Jan 19, 2022

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found