From 8c22f6bf65f57c820201a2f02b8137fe78127a4b Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Fri, 9 Oct 2015 18:14:01 -0700 Subject: [PATCH] fix(html-parser): Never blow up, just send us HTML parsing errors --- src/services/quoted-html-parser.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/services/quoted-html-parser.coffee b/src/services/quoted-html-parser.coffee index ab38dff7c..4e63194b5 100644 --- a/src/services/quoted-html-parser.coffee +++ b/src/services/quoted-html-parser.coffee @@ -74,7 +74,12 @@ class QuotedHTMLParser _parseHTML: (text) -> domParser = new DOMParser() - doc = domParser.parseFromString(text, "text/html") + try + doc = domParser.parseFromString(text, "text/html") + catch error + text = "HTML Parser Error: #{error.toString()}" + doc = domParser.parseFromString(text, "text/html") + atom.emitError(error) return doc _wholeBodyIsQuote: (doc, quoteElements) ->