@ -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)