fix: title wasn't cleaning html tags

pull/1/head
Adam Pash 8 years ago
parent 956fd678f7
commit d3b791d516

@ -18,5 +18,6 @@ export default function cleanTitle(title, url, $) {
}
}
return title.trim()
// strip any html tags in the title text
return stripTags(title, $).trim()
}

@ -20,8 +20,8 @@ describe('cleanTitle(title, $)', () => {
})
it('removes HTML tags from titles', () => {
const title = "Too Short"
const $ = cheerio.load(HTML.docWithTagsInH1.before)
const title = $('h1').html()
assert.equal(cleanTitle(title, '', $), HTML.docWithTagsInH1.after)
})

Loading…
Cancel
Save