diff --git a/HTMLView.js b/HTMLView.js index a3e9672..d3c1b6a 100644 --- a/HTMLView.js +++ b/HTMLView.js @@ -12,6 +12,7 @@ var PARAGRAPH_BREAK = '\n\n' var BULLET = ' \u2022 ' function htmlToElement(rawHtml, opts, done) { + function domToElement(dom, parent) { if (!dom) return null @@ -23,7 +24,7 @@ function htmlToElement(rawHtml, opts, done) { if (node.type == 'text') { return ( - + {entities.decodeHTML(node.data)} ) @@ -49,6 +50,11 @@ function htmlToElement(rawHtml, opts, done) { }) } + function inheritedStyle(parent) { + var style = [opts.styles[parent.name] || {}]; + return parent.parent ? style.concat(inheritedStyle(parent.parent)) : style; + } + var handler = new htmlparser.DomHandler(function (err, dom) { if (err) done(err) done(null, domToElement(dom))