mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
13 lines
335 B
JavaScript
13 lines
335 B
JavaScript
|
const htmlToText = require('html-to-text');
|
||
|
|
||
|
module.exports = function htmlToPlaintext(html) {
|
||
|
return htmlToText.fromString(html, {
|
||
|
wordwrap: 80,
|
||
|
ignoreImage: true,
|
||
|
hideLinkHrefIfSameAsText: true,
|
||
|
preserveNewlines: true,
|
||
|
returnDomByDefault: true,
|
||
|
uppercaseHeadings: false
|
||
|
});
|
||
|
};
|