Closed
Description
Hi,
I have started developing with html-to-text and discovered that it expects every anchor to have a href and crashes when it doesn't find one.
Changing line 25 in formatter.js from
return elem.attribs.href.replace(/^mailto\:/, '');
to
if (elem.attribs && elem.attribs.href) {
return elem.attribs.href.replace(/^mailto\:/, '');
}
else {
return helper.wordwrap(helper.decodeHTMLEntities(_s.strip(elem.raw)), options.wordwrap);
}
fixes this.
Thank you!