Skip to content
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

Style Element in <head> #359

Open
seneca opened this issue Sep 12, 2024 · 1 comment
Open

Style Element in <head> #359

seneca opened this issue Sep 12, 2024 · 1 comment
Labels
bug nuekit Related to nuekit package

Comments

@seneca
Copy link
Contributor

seneca commented Sep 12, 2024

Describe the Bug

Previous beta b.1 would choke if <style> element was added to the <head> section in a html file.
The latest beta b.2 accepts <style> element in the <head> but still chokes if one adds any CSS selector there.

Environment

  • OS: Mac
  • Package Manager: bun -1.1.28
  • JS Runtime: bun

Minimal Reproduction

Create an index.html page in a folder (allowed as per the documentation ) add <style> element to the <head> element with any CSS rule in it. You will get the error below.
If <style> element is empty there is no error. It seems the parser chokes on ";".

Logs & Additional Context

I get the following error:

{
title: "Rendering error",
expr: "\n h1 {\n color: orange;\n }\n ",
subexpr: ";",
text: "SyntaxError: Unexpected token",
line: 25,
}

The documentation states that:
You can go extreme and override the entire html element in which case you can customize everything inside the html element, including the document head.
If the <style> element is not allowed in the <head> element for some reason then we should update the documentation.

@seneca seneca added the bug label Sep 12, 2024
@nobkd nobkd changed the title Style Element in Style Element in <head> Sep 12, 2024
@nobkd nobkd added the nuekit Related to nuekit package label Sep 15, 2024
@tipiirai
Copy link
Contributor

Thanks. I'll probably disable inline <style> elements and make Nue output a warning on the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug nuekit Related to nuekit package
Projects
None yet
Development

No branches or pull requests

3 participants