Function Core.getHtmlOfUrl returns promise. So you need return this promise to a caller.
export function url(externalUrl, language = '', format = 'default', options = {
lengthLow: LENGTH_LOW_DEFAULT,
lengthHigh: LENGTH_HIGH_DEFAULT,
stopwordsLow: STOPWORDS_LOW_DEFAULT,
stopwordsHigh: STOPWORDS_HIGH_DEFAULT,
maxLinkDensity: MAX_LINK_DENSITY_DEFAULT,
maxHeadingDistance: MAX_HEADING_DISTANCE_DEFAULT,
noHeadings: NO_HEADINGS_DEFAULT,
}) {
return Core.getHtmlOfUrl(externalUrl).then((response) => {
const htmlText = response.data;
return rawHtml(htmlText, language, format, options);
}).catch((error) => {
throw error;
});
}
And justext.url(url, language, 'detailed', options).then((data)=>console.log(data));
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too