4b. Summarizer feature #17

Merged
senaduka merged 19 commits from summarizer-feature into master 2018-04-16 12:12:53 +02:00
Showing only changes of commit b5d66c950a - Show all commits

View File

@@ -28,15 +28,16 @@ getDataFromWPJSON = function (sourceUrl, page = 1, maxPosts = 10) {
}; };
summarizeText = function (text, length, clearText = true) { summarizeText = function (text, length, clearText = true) {
let preparedText = text;
if (clearText) { if (clearText) {
text = htmlToText.fromString (text, { preparedText = htmlToText.fromString (text, {
wordwrap: false, wordwrap: false,
ignoreHref: true, ignoreHref: true,
ignoreImage: true, ignoreImage: true,
}); });
} }
return summarizer (text, {n: length}); return summarizer (preparedText, {n: length});
}; };
getTitlesFromWP = function (sourceUrl) { getTitlesFromWP = function (sourceUrl) {