Tags with single quotes inside double quotes doesn't get parsed/truncated correctly according to the limit (by words/characters)
Steps to Reproduce
ddownsize('<p><img src="/someUrl.jpg" alt="Let\'s get in!"></p><p>hello world</p>', {words:"1"});
results to:
'<p><img src="/someUrl.jpg" alt="Let\'s get in!"></p><p>hello world</p></p>'
But it should result to:
'<p><img src="/someUrl.jpg" alt="Let's get in!"></p><p>hello</p>'
This is a bug because the specified number of html words should be followed even if the alt text of the has a single quote/apostrophe.
Issue Summary
Tags with single quotes inside double quotes doesn't get parsed/truncated correctly according to the limit (by words/characters)
Steps to Reproduce
ddownsize('<p><img src="/someUrl.jpg" alt="Let\'s get in!"></p><p>hello world</p>', {words:"1"});
results to:'<p><img src="/someUrl.jpg" alt="Let\'s get in!"></p><p>hello world</p></p>'
But it should result to:
'<p><img src="/someUrl.jpg" alt="Let's get in!"></p><p>hello</p>'
This is a bug because the specified number of html words should be followed even if the alt text of the has a single quote/apostrophe.
Technical details
directly related to: https://github.com/TryGhost/Ghost/issues/2106