Skip to content

Commit

Permalink
iarna#5 Fix for README example doesn't work.
Browse files Browse the repository at this point in the history
  • Loading branch information
Romick2005 committed Jan 9, 2019
1 parent 777b72a commit 41c1b46
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rtf-to-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ function rtfToHTML (doc, options) {
paraTag: 'p',
template: outputTemplate
}, options || {})
const content = doc.content.map(para => renderPara(para, defaults)).filter(html => html != null).join(defaults.paraBreaks)
const content = doc.content.map(
function (para) {
if (para.content) {
return renderPara(para, defaults);
}
return renderPara({content: [para], style: {}}, defaults);
}
).filter(html => html != null).join(defaults.paraBreaks)
return defaults.template(doc, defaults, content)
}

Expand Down

1 comment on commit 41c1b46

@cspmosh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked for me, thanks!

Please sign in to comment.