freeCodeCamp / curriculum-helpers

An internal package that allows thorough testing of challenges between multiple freeCodeCamp platforms.
BSD 3-Clause "New" or "Revised" License
19 stars 13 forks source link

feat: add html element extractor #229

Open a2937 opened 2 months ago

a2937 commented 2 months ago

Checklist:

Closes #XXXXX

A variation of this particular regex was used in PRs like https://github.com/freeCodeCamp/freeCodeCamp/pull/55547. I expect this kind of thing to come up a little bit more often in the future which is why I'm adding it to your curriculum helpers. I've also generalized this in an attempt to increase the usefulness. Though without that extra parameter present it will just extract head elements.

ShaunSHamilton commented 2 months ago

We can definitely add this, but I disagree with this expectation:

I expect this kind of thing to come up a little bit more often in the future which is why I'm adding it to your curriculum helpers.

Ideally, Regex should NOT be used at all for the tests. In that one case, it is forcibly used, because the browser changes the html in the preview.

a2937 commented 2 months ago

Yeah ideally it shouldn't.

a2937 commented 2 months ago

I also hopefully will find a way to convert this from Regex into something that uses string manipulation methods.