I think it should be:
$output(text) =>
text = text.replaceAll("Allo","~allo~");
return text;
You need to set the text
to the replaced text. See the Preprocessor page.
This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.
Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)
This community is mainly for discussions between those who are building generators. For discussions about using generators, especially the popular AI ones, the community-led Casual Perchance forum is likely a more appropriate venue.
See this post for the Complete Guide to Posting Here on the Community!
1. Please follow the Lemmy.World instance rules.
2. Be kind and friendly.
3. Be thankful to those who try to help you.
4. Only post about stuff related to perchance.
5. Refrain from requesting Prompts for the AI Tools.
text-to-image-plugin
and ai-text-plugin
) e.g. "What is the good prompt for X?", "How to achieve X with Y generator?"6. Search through the Community Before Posting.
I think it should be:
$output(text) =>
text = text.replaceAll("Allo","~allo~");
return text;
You need to set the text
to the replaced text. See the Preprocessor page.
that did nothing ty tho i tried it
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
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.
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.
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.