Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/emailreplyparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ Email.prototype = {

var visible_text = [];
for (var key in this.fragments) {
if (!this.fragments[key].hidden || (include_signatures && this.fragments[key].signature)) {
if (this.fragments.hasOwnProperty(key) &&
!this.fragments[key].hidden || (include_signatures && this.fragments[key].signature)) {
visible_text.push(this.fragments[key].to_s());
}
}
Expand Down Expand Up @@ -168,7 +169,9 @@ Email.prototype = {
var lines = text.split('\n');

for(var i in lines) {
this.scan_line(lines[i]);
if (lines.hasOwnProperty(i)) {
this.scan_line(lines[i]);
}
}

// Finish up the final fragment. Finishing a fragment will detect any
Expand Down Expand Up @@ -316,4 +319,4 @@ Fragment.prototype = {

module.exports.EmailReplyParser = EmailReplyParser;

//console.log(EmailReplyParser.read("I get proper rendering as well.\n\nSent from a magnificent torch of pixels\n\nOn Dec 16, 2011, at 12:47 PM, Corey Donohoe\n<[email protected]>\nwrote:\n\n> Was this caching related or fixed already? I get proper rendering here.\n>\n> ![](https://img.skitch.com/20111216-m9munqjsy112yqap5cjee5wr6c.jpg)\n>\n> ---\n> Reply to this email directly or view it on GitHub:\n> https://github.com/github/github/issues/2278#issuecomment-3182418\n"));
//console.log(EmailReplyParser.read("I get proper rendering as well.\n\nSent from a magnificent torch of pixels\n\nOn Dec 16, 2011, at 12:47 PM, Corey Donohoe\n<[email protected]>\nwrote:\n\n> Was this caching related or fixed already? I get proper rendering here.\n>\n> ![](https://img.skitch.com/20111216-m9munqjsy112yqap5cjee5wr6c.jpg)\n>\n> ---\n> Reply to this email directly or view it on GitHub:\n> https://github.com/github/github/issues/2278#issuecomment-3182418\n"));