Extendible-BBCode-Parser icon indicating copy to clipboard operation
Extendible-BBCode-Parser copied to clipboard

Can errors be ignored?

Open mark22 opened this issue 6 years ago • 4 comments

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!

mark22 avatar Oct 01 '18 00:10 mark22

For now there’s no easy way I know of to detect and ignore small errors, sorry.

patorjk avatar Oct 01 '18 18:10 patorjk

@patorjk Darn. Do you think there is a way to close the mismatched tags so it would not error?

mark22 avatar Oct 01 '18 23:10 mark22

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 avatar Oct 02 '18 12:10 patorjk

@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!

mark22 avatar Oct 03 '18 15:10 mark22