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
});
};