-
Notifications
You must be signed in to change notification settings - Fork 110
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
Improve Encode.forHtmlAttribute docs #72
base: main
Are you sure you want to change the base?
Conversation
@@ -243,7 +243,7 @@ public static void forHtmlContent(Writer out, String input) | |||
* | |||
* <b>Example JSP Usage</b> | |||
* <pre> | |||
* <div><%=Encode.forHtmlAttribute(unsafeData)%></div> | |||
* <input value="<%=Encode.forHtml(unsafeData)%>" title='<%=Encode.forHtml(moreUnsafeData)%>' /> | |||
* </pre> |
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.
Inspired by the JSP example in forHtml()
JavaDocs, but demonstrates usage with both single-quotes and double-quotes.
@@ -276,6 +276,8 @@ public static void forHtmlContent(Writer out, String input) | |||
* | |||
* <p><b>Additional Notes</b></p> | |||
* <ul> | |||
* <li>When using this method, the caller must provide quotes around the attribute value.</li> |
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.
Don't like this phrasing, but I chose it because forHtmlUnquotedAttribute()
JavaDocs use similar phrasing.
Disclaimer: I've put these minor doc changes together through the Github web UI. Haven't actually generated JavaDocs from it yet. |
See issue #71.