Skip to content

Function url is incorrect #2

Description

@mainvov

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions