chanobol icon indicating copy to clipboard operation
chanobol copied to clipboard

Improve CommentParser

Open eugenkiss opened this issue 9 years ago • 1 comments

The class CommentParser is adapted from Clover's ChanParser. I have changed the code a bit. For example, make it recursive in the 'b'-case such that the sticky of /fit/ is rendered correctly and its line breaks are preserved. I've changed the code around ClickableSpans to fit Chanobol's data model. In general, I'd like to improve the code further (e.g. make all cases recursive) and maybe simpler but only if there was a test suite of comments such that I can be surer that changes do not break the parsing. As it stands the code is obviously tried and tested in the wild and that's a quality in itself.

But here and there I still find some error's in parsing (mostly missing newline) which are probably due to the cases not being recursive. This is a laborious task and Clover could profit from the code at the same time.

eugenkiss avatar Mar 14 '15 12:03 eugenkiss

An interesting complaint from one user is that links behind spoilers don't work which makes sense if you know the code. Making every case recursive would fix this problem most probably.

eugenkiss avatar Mar 23 '15 16:03 eugenkiss