Extendible-BBCode-Parser
Extendible-BBCode-Parser copied to clipboard
Can errors be ignored?
Right now If i give it this BBCode
[quote] [/b]Testing [/quote]
It won't parse at all, because of the misaligned tags. But since this is a fairly benign user error, is there a way to have the script ignore the errors and atleast still parse the quote bbcode?
Thanks for the amazing script otherwise!
For now there’s no easy way I know of to detect and ignore small errors, sorry.
@patorjk Darn. Do you think there is a way to close the mismatched tags so it would not error?
You'd have to edit the lib to catch that kind of case, which may be easy for this case, but you could end up going down a rabbit hole on what kind of errors you want to ignore or what errors make sense to ignore, and not all of them would be easy to catch and correct in a way that makes sense.
@patorjk Definitely would want this to work in every case of a mismatched tag. I found the lines where the mismatched tag error message is added to the errorqueue, and tried to work on ret.html from here. But it seems that at this point the script just looks to see if there are any '[' or ']' and if they are there it knows there was a problem with the processing in replacing all the [] tags, is that correct? If so, then this probably is not the place to try to correct the mismatched tags because its already too late, in a sense?
Thanks!