trying this: https://perchance.org/preprocessors

so i didn’t get it to work and eventually did the simplest form but gives error.

i started with altering my name just to mess with stuff


$output(text) =>
  text.replaceAll("Allo","~allo~");
  return text;

(all the examples have the ; so maybe it needs em)

is all the preprocessor is.
and the importerizor is just:
$preprocess = {import:allopreprocess}

yet terrible error: TypeError: Cannot read properties of undefined (reading 'getSelf') at Object.get

i pretty much copypasted stuff and changed a few variables so i is the confuze as to how wrong

  • alloOP
    link
    English
    18 months ago

    interestingly i just, from the preprocessor page, imported the one shown, $preprocess = {import:inline-dent-preprocessor}

    still gives the same error perhaps preprocessors in general are down? have not gotten a built in nor suggested one to not bug even when straight copypasting the import over

    • VioneTM
      link
      English
      18 months ago

      I checked your code at https://perchance.org/allopreprocess, and it should be:

      $output(text) =>
        text = text.replaceAll(":smile:", "😊");
        return text;
      

      not

      $preprocess(text) =>
        text = text.replaceAll(":smile:", "😊");
        return text;
      

      It should always be an $output for the generator that is being imported.

      • alloOP
        link
        English
        28 months ago

        Ok I have figured it out I think. There initially was no actual problem. for some reason, initially upon adding a preprocessor, there is a mysterious error message that pops up any time it is run within the edit window. But do fullscreen and reload the page and the error message goes away and, interestingly, entering edit mode again the error doesn’t come back.

        can be seen easily by going here https://perchance.org/inline-dent-preprocessor then hitting edit, then hitting save. then see error message. that error message is what i was getting and was is apparently solved by going fullscreen and reloading page.

        • VioneTM
          link
          English
          18 months ago

          Yeah, I think it is because ‘preprocessor’ is applied before everything else. Which throws error upon first run, then the content is then cached/preloaded, which then resolves itself after.

      • alloOP
        link
        English
        18 months ago

        deleted by creator

      • alloOP
        link
        English
        18 months ago

        deleted by creator