Feature proposal #6440
closedImplement replacer functionality to Parser
100%
Description
This would remove and words that have been forbidden as configured in backend (probably a repeat usage? or just a textarea field?). This should just be a part of the new Parser functions (which turns of emote parsing, etc.. for streams).
EDIT: This is being changed to a generic replacer functionality. It can be used for bad word filtering or just adding your own custom word replacements.
Updated by krileon over 8 years ago
Would be good if it supported regexp forbidden word removal as well. In addition to allowing supply of a replacement word.
Updated by krileon over 8 years ago
- % Done changed from 0 to 50
This is being turned into a generic replacer functionality. Can be used for word by word replacements using strings or regexp. Can also be used to do string replacements or regexp on the entire string. Syntax thus far is as follows.
WORD=REPLACE
This flat replaces the word WORD with REPLACE. Words are parsed by a space. If you want to apply the replacement on the entire string instead of per word you'd use the following.
{s}WORD{/s}=REPLACE
If you want to replace with REGEXP you'd use the below.
{r}/WORD/{/r}=REPLACE
Now for regexp on the entire string you'd use the below.
{s}{r}/WORD/{/r}{/s}=REPLACE
This usage is only for non-CB parameter usages though. CB it self will provide a nice repeat usage with appropriate parameters to select all of this, but Joomla parameters don't support that so they'll use a plain textarea field.
Note replacer is applied before all other parsing options EXCEPT substitutions to allow it to do replacement/filtering on the substitution results.
Updated by krileon over 8 years ago
- Subject changed from Implement forbidden words functionality to Parser to Implement replacer functionality to Parser
- Description updated (diff)
Updated by krileon over 8 years ago
Ok, for Joomla usage to avoid conflicts with JSON parsing you can use the below.
string:test=123
The above is for full string replacement. The below is for regexp replacement.
regexp:/test/=123
To combine them you'd use the following.
string:regexp:/test/=123
Updated by krileon over 8 years ago
- % Done changed from 50 to 0
This should just be redone as its own database and backend usage like Emotes. It can be called Filters and be applied to all streams as per stream configuration of filters would just be too complex.
Updated by krileon over 8 years ago
Is this really necessary? CB Replacer Bot with content prepare enabled can handle this usage.
Updated by krileon over 8 years ago
- Status changed from Assigned to Rejected
- Target version deleted (
4.0.0) - % Done changed from 0 to 100
Enable content prepare then use CB Replacer Bot if this behavior is necessary otherwise it's just duplication of code.