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