Skip to content

sup not working in code (at least in Firefox) #858

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
wants to merge 2 commits into from
Closed

sup not working in code (at least in Firefox) #858

wants to merge 2 commits into from

Conversation

joendres
Copy link

@joendres joendres commented Jan 2, 2021

grafik

@joendres joendres requested a review from a team as a code owner January 2, 2021 17:46
@joendres joendres requested a review from Elchi3 January 2, 2021 17:46
@nschonni
Copy link
Contributor

nschonni commented Jan 2, 2021

Looks like Yari might be stripping them out
image

@sideshowbarker
Copy link
Member

Looks like Yari might be stripping them out

Alerting @mdn/core-yari-dev

@peterbe
Copy link
Contributor

peterbe commented Jan 5, 2021

Yeah this is tricky. We've moved to using PrismJS on the server (in Node) which operates differently.
One of the things we lost is the ability to highlight specific lines. Another is the ability to inject custom HTML tags into the snippet code. Basically, we're about as basic as Markdown is when you inject code with triple-back-ticks. And moving to a more constrained formatting tool (like Markdown) is something we probably want to do in 2021.

In Yari, all the code in the <pre> is treated as text. Almost like when a human, using a browser, highlights the text with the mouse cursor and then copies and pastes into notepad.

PrismJS in Node is much more limited than PrismJS in the browser :(
Many PrismJS plugins don't work. But at least we now have support for ~16 lexers without any added weight to the JS bundles.

The other thing to keep in mind is that there are huge advantages of treating the snippet code as plain text. For example, we could run automation on it and do things like auto-format based on Prettier. If the snippet code now also contains formatting, that might make things much harder.
Similarly, when I code in VS Code, to type code comments my only formatting is to use * or similar characters to create emphasis or padding.

Co-authored-by: Michael[tm] Smith <mike@w3.org>
@wbamberg
Copy link
Collaborator

I looks like this has already been fixed to use ^:

<pre class="brush: js">const biggestInt = Number.MAX_SAFE_INTEGER // (2^53 - 1) =&gt; 9007199254740991
const smallestInt = Number.MIN_SAFE_INTEGER // -(2^53 - 1) =&gt; -9007199254740991</pre>

@wbamberg wbamberg closed this Apr 30, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants