Make Build.parseComment a bit more robust.

This commit is contained in:
ccd0 2015-04-25 10:56:30 -07:00
parent fdae25dc9e
commit 4a7d238ea9

View File

@ -80,10 +80,10 @@ Build =
parseComment: (o) -> parseComment: (o) ->
html = o.info.commentHTML.innerHTML html = o.info.commentHTML.innerHTML
.replace(/<br><br><span class="abbr">.*$/, '') .replace(/<br\b[^<]*>/gi, '\n')
.replace(/^<b>Rolled [^<]*<br><br><\/b>/, '') .replace(/\n\n<span\b[^<]* class="abbr"[^]*$/i, '') # EXIF data (/p/)
.replace(/<span class="fortune".*$/, '') .replace(/^<b\b[^<]*>Rolled [^<]*<\/b>/i, '') # Rolls (/tg/)
.replace(/<br\s*\/?>/gi, '\n') .replace(/<span\b[^<]* class="fortune"[^]*$/i, '') # Fortunes (/s4s/)
.replace(/<[^>]*>/g, '') .replace(/<[^>]*>/g, '')
o.info.comment = Build.unescape html o.info.comment = Build.unescape html