-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: master
Are you sure you want to change the base?
Conversation
src/plugins/mdn/mdnPlugin.js
Outdated
pageData = extractFromHtml(res.text); | ||
pageData = { | ||
title: res.body.documents[0].title, | ||
text: res.body.documents[0].excerpt.replace(/<\/?mark>/g, ''), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
* pass the appropriate query param to remove <mark> tags.
based on irc discussion and other concerns. this should probably be shelved for now. |
closes #7
Uses the v1 search api on MDN. removes a lot of code in the process as well.