mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-22 23:23:54 +08:00
fix(html-parser): Never blow up, just send us HTML parsing errors
This commit is contained in:
parent
2859baa134
commit
8c22f6bf65
1 changed files with 6 additions and 1 deletions
|
@ -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) ->
|
||||
|
|
Loading…
Reference in a new issue