eugenkiss/chanobol

Improve CommentParser

Open

#139 opened on Mar 14, 2015

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Java (11 forks)github user discovery
codeenhancementhelp wanted

Repository metrics

Stars
 (52 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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.

Contributor guide