Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

meeque
Copy link

@meeque meeque commented Apr 18, 2024

See issue #71.

@@ -243,7 +243,7 @@ public static void forHtmlContent(Writer out, String input)
*
* <b>Example JSP Usage</b>
* <pre>
* &lt;div&gt;&lt;%=Encode.forHtmlAttribute(unsafeData)%&gt;&lt;/div&gt;
* &lt;input value=&quot;&lt;%=Encode.forHtml(unsafeData)%&gt;&quot; title=&#39;&lt;%=Encode.forHtml(moreUnsafeData)%&gt;&#39; /&gt;
* </pre>
Copy link
Author

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>
Copy link
Author

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.

@meeque
Copy link
Author

meeque commented Apr 18, 2024

Disclaimer: I've put these minor doc changes together through the Github web UI. Haven't actually generated JavaDocs from it yet.

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.

None yet

1 participant