-
Notifications
You must be signed in to change notification settings - Fork 443
feat(gnoweb): support required attribute for markdown form fields #4974
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
base: master
Are you sure you want to change the base?
Conversation
🛠 PR Checks Summary🔴 Changes related to gnoweb must be reviewed by its codeowners Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
| if tok.Type != html.SelfClosingTagToken { | ||
| node.addElement(FormSelect{Error: ErrFormInvalidTag}) | ||
| return | ||
| if tok.Type != html.SelfClosingTagToken && tok.Type != html.StartTagToken { |
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.
why add this 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.
safety but it is indeed redundant, so I will remove it
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.
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.
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.
The required flag only controls whether the required attr is added or not, and all other user unputs are properly handled with HTMLEscapeString, so there doesn't appear to be any injection threat in this PR. LGTM
EDIT: Some CIs are failing now. could you check this if possible? thank you
|
Maybe required form fields could be parsed to render with the required attribute, that way forms would get basic default browser validation on submit click, if it makes sense |

Description
Closes #4970
This PR adds support for the required="true" attribute in Gno-flavored markdown form fields.
Usage
required="true"can be added to:<gno-input>,<gno-textarea>,<gno-select>Preview