0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/core/shared/html-to-plaintext.js

13 lines
339 B
JavaScript
Raw Normal View History

module.exports = function htmlToPlaintext(html) {
const htmlToText = require('html-to-text');
return htmlToText.fromString(html, {
wordwrap: 80,
ignoreImage: true,
hideLinkHrefIfSameAsText: true,
preserveNewlines: true,
returnDomByDefault: true,
uppercaseHeadings: false
});
};