New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add content format output options #256

Merged
merged 4 commits into from Feb 8, 2019

Conversation

Projects
None yet
1 participant
@adampash
Copy link
Contributor

adampash commented Feb 7, 2019

Adds an option to choose the output format of the content. Default is html, but supports markdown and text.

Sample usage:

Mercury.parse(url, null, { contentType: 'markdown' })
mercury-parser url markdown

This is a WIP. I should probably do a proper --format=markdown CLI argument, and it might be worth changing the signature of the main parse function to Mercury.parse(url, { html, contentType, ...etc }).

adampash added some commits Feb 7, 2019

feat: allow user to choose contentType for returned content
Allows `html` (default), `markdown`, or `text`
change Mercury.parse signature
Mercury.parse(url, options) instead of
Mercury.parse(url, html, options)

`html` is now a property of options.

@adampash adampash merged commit 9b0664b into master Feb 8, 2019

2 checks passed

ci/circleci: test-node Your tests passed on CircleCI!
Details
ci/circleci: test-web Your tests passed on CircleCI!
Details

@adampash adampash deleted the feat-add-content-format-output-options branch Feb 8, 2019

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