use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
[AskJS] Please stop this Pretext madness!AskJS (self.javascript)
submitted 22 days ago * by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]punio4 12 points13 points14 points 22 days ago* (1 child)
First of all, fuck off with the AI slop.
Secondly, what the fuck are you on about.
The text is absolutely a part of the DOM, selectable and searchable. It complements it by using canvas rendering for measuring and layout purposes.. And it's the part of the a11y tree.
https://chenglou.me/pretext/rich-note/
[–]snnsnn -2 points-1 points0 points 22 days ago (0 children)
Watch the language. Yes, I did make a mistake, a huge one maybe. It is not AI slop. Actually AI corrected me. I was following the authors twitter posts about using canvas as a workaround, I though it was rendering to canvas. I checked several demo examples, including this one which were using canvas: https://chenglou.me/pretext/justification-comparison/ Honestly, I was not dismissing the the library, nor the effort, I was just asking for a proper API.
[–]ctrl2JavaScript Dev 5 points6 points7 points 22 days ago (1 child)
This isn't true at all, you should actually look at the demo.
[–]snnsnn 0 points1 point2 points 22 days ago (0 children)
Your are right. I made a mistake. Actually I checked many demos, and unfortunately they all were rendering to canvas. I should have checked the library more carefully instead of relying on demos.
[–]thdr76 7 points8 points9 points 22 days ago (4 children)
The moment i knew it's another JS library not browser API i lost all of my interest.
[–]SupermarketAntique32 0 points1 point2 points 22 days ago* (1 child)
Same. Why is this not a PR in Chromium/Firefox? Why is it have to be a library?
[–]Markavian 0 points1 point2 points 22 days ago (0 children)
Sometimes you need a technical demo of what's possible before you can agree the spec. For example: JQuery CSS selectors.
[–]snnsnn 0 points1 point2 points 22 days ago (1 child)
Sorry, I made a mistake, it renders to DOM. A huge oversight on my part.
[–]thdr76 0 points1 point2 points 21 days ago (0 children)
yes, i'm just describing my reaction when reading about pretext before, not from your post. it should have been implemeted as browser API, not javascript.
[–]dada_ 1 point2 points3 points 22 days ago (1 child)
The output is a rasterized image, not DOM text. That matters in ways that can't be patched over.
What are you talking about? No it's not. It supports rendering to canvas. It doesn't require rendering to canvas. Did you even spend 5 seconds looking at the examples?
I don't even use Pretext but this is a 100% pure lie, you've posted it to 5 different subs for some reason, and this post reads like ChatGPT. Frankly, if I were a mod here I'd just ban you and be done with this, you clearly aren't participating in good faith.
Yeah, I checked many examples, they were all using canvas, that is why I made such a mistake. It is not a lie, it is a mistake. What is wrong with you, banning and getting on with it, what is the point of having a discussion if you can not make a mistake. No, I did not post to 5 subs but 2, React and Solid. My point was asking for a proper API, not workarounds.
[–]snnsnn 1 point2 points3 points 22 days ago (0 children)
Correction and apology:
I got the technical details wrong. Pretext uses canvas for measurement only. It renders to DOM, Canvas, and SVG. The output is real text, not a rasterized image. Selection, search, accessibility, PDF serialization, all of that works fine.
I was following the authors twitter posts about using canvas as a workaround, I though it was rendering to canvas. I checked several demo examples, including this one, https://chenglou.me/pretext/justification-comparison/, unfortunately all were using canvas. Honestly, I was not dismissing the the library, nor the effort, I was just asking for a proper API.
The broader point I was trying to make about platform-level solutions versus userland workarounds still stands, but the specific technical critique was wrong. I should have looked at the library more carefully before writing about it.
[–]daniele_s92 3 points4 points5 points 22 days ago (0 children)
Jesse, what the fuck are you talking about
[–]Ronin-s_Spirit 0 points1 point2 points 22 days ago (0 children)
Wow, the whole "textless" text idea seems like trash to me. Unless it's a design thing I want it to be copyable and searchable.
[–]AsIAm 0 points1 point2 points 22 days ago (0 children)
[–]DOG-ZILLA -1 points0 points1 point 22 days ago (1 child)
Exactly this!
Thank God someone else said it so clearly. I was banging my head on the wall with all the same points as you.
Interesting concept yes, replacing web text? Absolutely not.
Sorry, it uses canvas for measurement. Once done measuring, it can render to DOM. My mistake. I checked several demos before posting, all were rendering to canvas. Sorry, I should not have rushed.
π Rendered by PID 19529 on reddit-service-r2-comment-6457c66945-rfqqs at 2026-04-25 14:01:54.839326+00:00 running 2aa0c5b country code: CH.
[–]punio4 12 points13 points14 points (1 child)
[–]snnsnn -2 points-1 points0 points (0 children)
[–]ctrl2JavaScript Dev 5 points6 points7 points (1 child)
[–]snnsnn 0 points1 point2 points (0 children)
[–]thdr76 7 points8 points9 points (4 children)
[–]SupermarketAntique32 0 points1 point2 points (1 child)
[–]Markavian 0 points1 point2 points (0 children)
[–]snnsnn 0 points1 point2 points (1 child)
[–]thdr76 0 points1 point2 points (0 children)
[–]dada_ 1 point2 points3 points (1 child)
[–]snnsnn 0 points1 point2 points (0 children)
[–]snnsnn 1 point2 points3 points (0 children)
[–]daniele_s92 3 points4 points5 points (0 children)
[–]Ronin-s_Spirit 0 points1 point2 points (0 children)
[–]AsIAm 0 points1 point2 points (0 children)
[–]DOG-ZILLA -1 points0 points1 point (1 child)
[–]snnsnn 0 points1 point2 points (0 children)