Skip to content

Handle noscript Better #2

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

Closed
rameshvarun opened this issue Jul 4, 2023 · 3 comments
Closed

Handle noscript Better #2

rameshvarun opened this issue Jul 4, 2023 · 3 comments

Comments

@rameshvarun
Copy link
Owner

Right now, with Javascript disabled, the code simply doesn't show at all. We should handle this better. Maybe let people create code cells in <pre> tags and transform them in-place into cells?

@Scepheo
Copy link

Scepheo commented Aug 24, 2023

Alternatively, you could add CSS to make the script tags visible:

script[type="text/notebook-cell"] {
  display: block;
}

This would also stop users from having to HTML-escape the content of pre tags.

@rameshvarun
Copy link
Owner Author

I had no idea this was possible - it works pretty well. You can even style with white-space: pre.

The one annoyance is that actual pre elements have some special logic to ignore the first line, as seen in the following HTML. Not really a big deal though, so I want to move forward with this approach.

<script type="text/notebook-cell">
console.log("Hello World!");
</script>

<pre class="notebook-cell">
console.log("Hello World!");
</pre>
Screenshot 2023-08-29 at 10 00 41 PM

@rameshvarun
Copy link
Owner Author

Released in v0.5.0

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

No branches or pull requests

2 participants