Repository navigation
Add support in BasicHtmlWebResponseObject for open-ended input tags - #16193
Merged
Dongbo Wang (daxian-dbw) merged 1 commit intoNov 2, 2021
Conversation
Ilya (iSazonov)
requested review from
Dongbo Wang (daxian-dbw) and
Rain Sallow (/u/ta11ow) (vexx32)
October 5, 2021 03:20
Collaborator
There was a problem hiding this comment.
Suggested change
| s_inputFieldRegex = new Regex(@"<input\s+[^>]*(/>|>|>.*?</input>)", | |
| s_inputFieldRegex = new Regex(@"<input\s+[^>]*(/?>|>.*?</input>)", |
I think this is a bit of an easier to read / simpler regex expression that should have the same result.
Austin Farmer (farmerau)
force-pushed
the
support-self-closing-input-tags-html
branch
from
October 7, 2021 00:44
bca62e6 to
337e349
Compare
- Supports open-ended (no end slash) input tags, to match void element spec. - Adds unit tests confirming other forms of input tags are unaffected. Update unit tests and simplify regular expression Leverage testcases
Austin Farmer (farmerau)
force-pushed
the
support-self-closing-input-tags-html
branch
from
October 7, 2021 08:54
337e349 to
9e51abe
Compare
Ilya (iSazonov)
approved these changes
Oct 7, 2021
Contributor
Author
|
Ilya (@iSazonov) is there a next step for merging? I'm not an authorized member. From what I can tell, it should be okay to happen 1 business day after approval. |
Collaborator
|
Austin Farmer (@farmerau) We are waiting MSFT members to review. Since it is Regex they can find compliance issues. /cc Dongbo Wang (@daxian-dbw) Travis Plunk (@TravisEz13) friendly ping. |
Dongbo Wang (daxian-dbw)
approved these changes
Oct 19, 2021
Collaborator
|
Austin Farmer (@farmerau) Thanks for your contribution! |
|
🎉 Handy links: |
TrapGodBrim
pushed a commit
to TrapGodBrim/PowerShell
that referenced
this pull request
Jan 19, 2022
Thatgfsj (Thatgfsj)
pushed a commit
to Thatgfsj-contribs/PowerShell
that referenced
this pull request
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Per #16126,
BasicHtmlWebResponseObjectdidn't fully support valid html forinputfields. Specifically, for anInvoke-WebRequestthat returns this valid html:would have a null
InputFieldsvalue.To solve this, I've added an alternative construct to the regular expression (as recommended by the author of the issue) that requires neither a closing slash '/' nor a closing input tag ''.
Additionally, I've created Pester test cases to validate the outcome of the updated expression.
PR Context
(For reference #15973)
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).