Closed ghost closed 6 years ago
Updated PR to fix/support the URL link pointing to the challenge's location on learn.freecodecamp.org.
This is a really good pull request. Briefly scanning through the code, I figure we could replace a few more elements.
<img>
could be transformed into a markdown image ![alt](url)
(or link if images not supported)<a>
could be transformed into a markdown link [text](url)
<b>
, <strong>
could be transformed into a markdown bold **text**
<i>
, <em>
could be transformed into a markdown italic *text*
Thoughts?
The <img>
replacement would have to be done before stripping self-closing tags. In addition, would we want to replace <hr>
with a few underscores (or even an image of a horizontal grey line?)
I consider handling img and a tags to be out-of-scope/unnecessary. I have not seen any evidence of img or a tags being used in challenge descriptions. They appear to be used exclusively as content for the built-in editor. When appearing in a description, they are HTML encoded as <...>
which then become displayed as html tags.
br, b, strong, and i tags have been handled.
I was unable to successfully convert <hr>
to horizontal lines through markdown using this guide - testing ---
, - - -
, and ***
all embedded as those literal strings.
Alright, could you add
<dfn>
<em>
- italics<strong>
boldImage tags are being phased out for screen readers. Links, however, remind me of another thing (perhaps out of scope of this PR, but possibly for a follow-up), I believe at the footer of challenges is a list of links to helpful resources. This could be added to the search functionality?
Also, would it be useful to add a url
parameter to the embed. This makes the title clickable, and will open up the challenge page?
v2 added back in support for URL clickable titles that send users to the FCC challenge page. It's possible that some challenges do have links in the description, but not all - perhaps a good follow-up issue if needed.
Other changes made as requested. Thanks for the feedback 👍
I should have acknowledged the intent behind the question of the trailing white space, and that is to remove all trailing white space from files I've been working in. Trailing white space has been removed from src/bot.js
and src/commands/scrapers/FCCCommand.js
in v5.
squashed 5 commits into 1
Resolves
Resolves #56
Changes
I had to make a decision about when to make fetch requests to get fcc curriculum data from FCC's Curriculum repo. Fetching this data every time a request is made is not practical. I chose instead that a sane option would be to fetch all the data when the bot starts, as opposed to when the bot installs.
These folders were created to help organize fetch endpoints and response data. githubEndpoints.json was created, because I was unable to automate the process of determining FCC's curriculum structure programmatically.
added src/commands/scrapers/data/fcc/challengeData.json - the response data from fetching githubEndpoints.json
Testing
Manual testing was performed and there appears to be no issues with any of the commands or core bot code.