https://perchance.org/8swe0svvsk#edit

The same exact call in a code block vs a script tag behaves differently. The values seem to arrive to the plugin okay, but then get funky at some point–no idea why.

  • @wthit56OP
    link
    English
    11 month ago

    Honestly, I think the real issue is that everything is monkey-patched. Which means you cannot escape everything getting “perchanced” all over the place. Which means if you want things to work “normally” you have to re-escape everything just in case. And even then it might blow up–who knows?

    If there was simply a difference between a string made with perchance (or explicitly perchance-ified), which has all the extras attached, and a string you just make in JavaScript, then none of this would be an issue. (Is my guess.) And same goes for all objects. Like, nothing is monkey-patched unless it’s perchance-ified, and then it works in the perchance-y way.

    There’s a lot of head-scratching, frustrations, and table-flipping that happens when I do certain things in simple JS that’s then “taken over” or otherwise messed with by the perchance engine. There are so many caveats and edge cases and weird behaviours you wouldn’t expect if you actually know JS, know what I mean?

    I understand the goal of all these things is to make it easy for non-programmers who don’t know JS to use it. But if you do know JS at times it can feel like you’ve stepped into bizarro-land where everything is upside-down and all your knowledge and skill just works against you. 😂😭😵‍💫

    • @perchanceM
      link
      English
      11 month ago

      If there was simply a difference between a string made with perchance (or explicitly perchance-ified), which has all the extras attached, and a string you just make in JavaScript, then none of this would be an issue.

      Wait, this sounds like a separate bug report. The issue I’m talking about is (I thought) only relevant to Perchance nodes, not raw strings. Can you give an example where Perchance interferes with your <script> tag where the text you’re manipulating doesn’t come from a Perchance node/property?

      • @wthit56OP
        link
        English
        11 month ago

        The example I linked you to in the original post uses pure JS to produce the problem, yes. 😅 https://perchance.org/8swe0svvsk#edit

        The original issue was a script tag passing a JS-made string into a function. Versus a code block passing a JS-made string into a function. The same exact string, declared in JS. But the function call was from a script tag vs from a code block. That JS-made string would evaluate differently depending on whether a script was being processed at the time or a code block was being processed at the time. Something like that.

        • @perchanceM
          link
          English
          1
          edit-2
          1 month ago

          Oh, right, yes, when using evaluateText on said string, that makes sense - due to square blocks having the policy of always “saving escape-char-processing until right at the end” as mentioned above. And yeah I agree this inconsistency is very annoying!