Skip to content
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

Use mdn search api v1 vs parsing html from mdn.io redirects. #40

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Use mdn search api v1 vs parsing html from mdn.io redirects. #40

wants to merge 5 commits into from

Conversation

adedomin
Copy link

closes #7
Uses the v1 search api on MDN. removes a lot of code in the process as well.

pageData = extractFromHtml(res.text);
pageData = {
title: res.body.documents[0].title,
text: res.body.documents[0].excerpt.replace(/<\/?mark>/g, ''),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be stripping all HTML here?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you can pass highlight=false in the query to not get these <mark> elements.

https://developer.mozilla.org/en-US/docs/MDN/Contribute/Tools/Search

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to know. just fixed it.

@adedomin
Copy link
Author

based on irc discussion and other concerns. this should probably be shelved for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use MDN JSON data instead of parsing HTML
2 participants