Search
return html without it ever being evaluated.
I'm now coming up against the issue you thought I was having before. Where after a [code block]
is processed it's evaluated. But if using a <script>
tag to do things it won't be.
I don't want evaluation to happen. So I could escape perchance specials to work right when returned to a code block, but they won't be evaluated by scripts so they'll still be there on the page. Or I could not escape perchance specials to work right from scripts, but they will be evaluated by code blocks which I don't want. I just want plain text to always come out no matter what.
And there's (seemingly) no way of knowing if it's going to be evaluated at the end of a code block or not. And no way of just telling perchance "LEAVE THIS STRING ALOOOOOONE!!"
Is there anything I can do or is this just not possible in any way?
If not, I'd really super-duper like it if you could add a way. Even if it is as simple and "dumb" as setting a property on the object like .DONTEVALUATETHIS = true
or something. I'd really appreciate it.
Or even something like if it has .evaluateItem = "..."
it'll automatically use that instead? Maybe? I tried that in case, and it didn't work.
Honestly, I'm surprised this isn't an issue for all sorts of plugins. Though maybe it is assumed that everyone only ever calls anything from code blocks and not scripts. Or people just don't think about or have instances where the plugin returns HTML that includes specials that they want to stay plain text.
But as I'm doing my best to make my plugin bulletproof no matter how it's used... it's driving me insane 😅
Very odd things going on with giving objects
I explored this here: https://perchance.org/481tgbwo1k#edit
I can't even guess as to what's happening with some of this. Most bizarre...
Setting document.body.innerHTML triggered by a breaks saving
As seen here: https://perchance.org/ius2f4kd5y#edit
<script defer>
It seems there is no way to have scripts run after everything else. Normally I'd use window.onload or similar things, but all that's been and gone by the time any script is run anyway. So I tried defer
. Normally defer means that script will run after non-defer scripts. That would be useful, but the defer
attribute isn't heeded by the engine, currently.
https://perchance.org/085unhhfqe#edit
For now I'm going to try using a [code block]
just to have it run later. But obviously that won't be sufficient for all situations. So it still would be useful to have some callback or addEventListener thingy to use to run code after perchance has done everything it does.
Don't find <html tags> inside from the HTML editor.
This is frustrating when making certain kinds of plugins. For example, you want to pass in some HTML, but you can't because perchance decides the block isn't code anymore.
Ideally, all code within a [code block]
would be ignored until its final ]
.
Oh while I'm on the topic... Please ignore any []
or {}
inside of <script>
tags or in things like onclick=""
attributes. Would make life a lot easier ;p