Skip to content

Commit

Permalink
Handle article with only an image, fixes #60
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Jul 12, 2016
1 parent 34ab821 commit c36b2da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ module.exports = class Flatten
caption = null
title = null
src = null
if tag.children.length is 1 and tag.children[0].name is 'img' and tag.children[0].attribs?.src
results.push
type: 'image'
html: @tagToHtml tag.children[0]
src: @normalizeUrl tag.children[0].attribs.src
return results
for child in tag.children
if child.name is 'h1' and not title
title = ''
Expand Down

0 comments on commit c36b2da

Please sign in to comment.