mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-09-21 18:08:51 +03:00
🐛 Fixed iframe's appearing weirdly in excerpts
- A few users had noticed they get weird content in their excerpts when using e.g. an html block with an iframe - This use case is common for people embedding podcasts at the top of their posts
This commit is contained in:
parent
9401d835ce
commit
27d1457a5b
@ -17,6 +17,8 @@ const baseSettings = {
|
||||
selectors: [
|
||||
// Ignore images, equiv ignoreImage: true
|
||||
{selector: 'img', format: 'skip'},
|
||||
// Ignore iframes
|
||||
{selector: 'iframe', format: 'skip'},
|
||||
|
||||
// disable uppercase headings, equiv uppercaseHeadings: false
|
||||
{selector: 'h1', options: {uppercase: false}},
|
||||
|
@ -86,5 +86,12 @@ describe('Html to Plaintext', function () {
|
||||
const {excerpt} = getEmailandExcert(html);
|
||||
assert.equal(excerpt, expected);
|
||||
});
|
||||
|
||||
it('iframes', function () {
|
||||
const html = '<!--kg-card-begin: html--><iframe frameborder="0" height="200" scrolling="no" src="https://playlist.megaphone.fm?e=1234567" width="100%"></iframe><!--kg-card-end: html--><p>Hello world.</p>';
|
||||
const expected = 'Hello world.';
|
||||
const {excerpt} = getEmailandExcert(html);
|
||||
assert.equal(excerpt, expected);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user