def cleanCommentData(comment): # FIXME bluetext for >>8675309 / >>>/g/7654321 type quotes stays blue until newline; # this affects just posts with body text after >> and >>> # FIXME make this take care of [code][/code] and [spoiler][/spoiler] tags comment = string.replace(comment, ">>>", TermColor.blue + '>>>') comment = string.replace(comment, ">>", TermColor.blue + '>>') comment = string.replace(comment, "<br>", '\n' + TermColor.reset) comment = string.replace(comment, ">", '>') comment = string.replace(comment, """, '"') comment = string.replace(comment, '<span class="quote">', TermColor.green) comment = string.replace(comment, '</span>', TermColor.reset) comment = stripTags(comment) return comment
def purifyCommentData(comment): comment = string.replace(comment, "<br>", ' ') comment = string.replace(comment, ">", '>') comment = string.replace(comment, """, '"') comment = stripTags(comment) return comment