fix(style): ignore corrupt inline styles

This commit is contained in:
Evan Morikawa 2015-09-09 16:02:20 -07:00
parent e14e462f62
commit 6a6619a106

View file

@ -333,7 +333,14 @@ class Application
ipc.on 'inline-style-parse', (event, {body, clientId}) =>
juice = require 'juice'
body = juice(body)
try
body = juice(body)
catch
# If the juicer fails (because of malformed CSS or some other
# reason), then just return the body. We will still push it
# through the HTML sanitizer which will strip the style tags. Oh
# well.
body = body
# win = BrowserWindow.fromWebContents(event.sender)
event.sender.send('inline-styles-result', {body, clientId})