i posted something similar a long time ago when i first tried to make a preprocessor and it gave errors until i had fullscreened the page and then minimized it. Again tried to delve in to preproccessors just now and again unsolvable errors and this time fullscreening did not fix it.

maybe it has to do with caching or something else? there is nothing typed about it on the preproccessor page about an issue. The inlineindent preprocessor seems to work without issue. its only newly created preprocessors that are problematic

like here https://perchance.org/46avv2s7of

  • @perchanceM
    link
    English
    2
    edit-2
    3 months ago

    In the 46avv2s7of generator you have this at that top, which is correct:

    $preprocess = {import:uniquelists}
    

    However, in the uniquelists generator you have this:

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

    It should instead be the $output of the uniquelists generator, like this:

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

    I can see how this confused you though! Preprocessors seem like a “special” thing, but they’re actually just regular old functions. So you import them just like you would a normal function, and you export/$output them like normal too. It’s only when you write $preprocess=<thing> that you’re using that function in a special way (i.e. as a preprocessor).

    • alloOP
      link
      English
      1
      edit-2
      3 months ago

      omg thank you that is actually what i was stuck on before now that i remember.

      so the issue is https://perchance.org/preprocessors the example is exactly what i copypasted. i did not change anything. the example is written incorrectly. could you please change the example?

      • @perchanceM
        link
        English
        3
        edit-2
        3 months ago

        Ah, so that example is correct, but the problem is it doesn’t make it clear that you don’t necessarily need to import a preprocessor. It can just be defined within the generator that you’re creating. So in 46avv2s7of you can just directly write:

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

        instead of importing it from uniquelists. I’ve added an error message to catch this sort of mistake and I’ll try to make it more clear on the /preprocessors page. Thanks!

        • alloOP
          link
          English
          23 months ago

          oh wow.

          learned a bunch of things today. thank you! :)