Skip to content

feat: add html element extractor - #229

Open
a2937 wants to merge 8 commits into
freeCodeCamp:mainfrom
a2937:feat/add-html-head-extractor
Open

feat: add html element extractor#229
a2937 wants to merge 8 commits into
freeCodeCamp:mainfrom
a2937:feat/add-html-head-extractor

Conversation

@a2937

@a2937 a2937 commented Aug 16, 2024

Copy link
Copy Markdown
Member

Checklist:

Closes #XXXXX

A variation of this particular regex was used in PRs like freeCodeCamp/freeCodeCamp#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.

@a2937
a2937 requested a review from a team August 16, 2024 17:39
@ShaunSHamilton

Copy link
Copy Markdown
Member

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

a2937 commented Aug 19, 2024

Copy link
Copy Markdown
Member Author

Yeah ideally it shouldn't.

Comment thread lib/index.ts Outdated
Co-authored-by: Naomi the Technomancer <accounts+github@nhcarrigan.com>
@a2937

a2937 commented Aug 19, 2024

Copy link
Copy Markdown
Member Author

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

Comment thread lib/index.ts Outdated
Comment thread lib/index.ts Outdated
@ojeytonwilliams

Copy link
Copy Markdown
Contributor

Hey @a2937 @ShaunSHamilton is this still something we want? Shaun, I know you had concerns.

@a2937

a2937 commented Mar 10, 2025

Copy link
Copy Markdown
Member Author

I can update the description and make the merge changes if this is something that seems useful.

@ShaunSHamilton

Copy link
Copy Markdown
Member

I think this can be useful. We just need the suggested changes and conflicts.

@ShaunSHamilton ShaunSHamilton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This would be confusing if we forget it defaults to head - there is no logical reason to default.

Comment thread lib/index.ts Outdated
Comment thread lib/index.ts Outdated
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
Comment thread lib/__tests__/curriculum-helper.test.tsx Outdated
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
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.

4 participants