assert.equal(email,'A snippet from a post template\n\nSee? Not that scary! But still completely optional.');
});
it('example case with figure + figcaption inside a link',function(){
constinput='<a href="https://mysite.com"><figcaption>A snippet from a post template</figcaption></figure></a><p>See? Not that scary! But still completely optional. </p>';
consthtml='<p>Testing<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>, my footnotes. And stuff. Footnote<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup><a href="http://google.com">with a link</a> right after.';
constexpected='Testing, my footnotes. And stuff. Footnotewith a link right after.';
const{excerpt}=getEmailandExcert(html);
assert.equal(excerpt,expected);
});
it('strips inline and bottom footnotes',function(){
consthtml='<p>Testing<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> a very short post with a single footnote.</p>\n'+
'<div class="footnotes"><ol><li class="footnote" id="fn:1"><p><a href="https://ghost.org">https://ghost.org</a> <a href="#fnref:1" title="return to article">↩</a></p></li></ol></div>';
constexpected='Testing a very short post with a single footnote.\n';
// This is an instagram embed, but with all the style attributes & svg content removed for brevity
consthtml='<p>Some text in a paragraph.</p><!--kg-card-begin: html--><blockquote class=\"instagram-media\" data-instgrm-captioned data-instgrm-permalink=\"https://www.instagram.com/p/AbC123dEf/?utm_source=ig_embed&utm_campaign=loading\" data-instgrm-version=\"14\"><div> <a href=\"https://www.instagram.com/p/AbC123dEf/?utm_source=ig_embed&utm_campaign=loading\" target=\"_blank\"><div><div></div><div><div></div><div></div></div></div><div></div><div><svg width=\"50px\" height=\"50px\" viewBox=\"0 0 60 60\" version=\"1.1\" xmlns=\"https://www.w3.org/2000/svg\" xmlns:xlink=\"https://www.w3.org/1999/xlink\"><!-- svg stuff --></svg></div><div><div>View this post on Instagram</div></div><div></div><div><div><div></div><div></div><div></div></div><div><div></div><div><div></div><div></div><div></div></div></div><div><div></div><div></div></div></a><p><a href=\"https://www.instagram.com/p/AbC123dEf/?utm_source=ig_embed&utm_campaign=loading\" target=\"_blank\">A post shared by Some Dude (@somedude)</a></p></div></blockquote><script async src=\"//www.instagram.com/embed.js\"></script><!--kg-card-end: html-->';
constexpected='Some text in a paragraph.\n\nView this post on Instagram\n\nA post shared by Some Dude (@somedude)';
const{excerpt}=getEmailandExcert(html);
assert.equal(excerpt,expected);
});
it('HRs',function(){
consthtml='<p>See you later alligator...</p><hr><p>...in a while crocodile</p>';
constexpected='See you later alligator...\n\n...in a while crocodile';