Skip to content

Commit

Permalink
Merge pull request #72 from meeque/issue/71-forHtmlAttribute-docs
Browse files Browse the repository at this point in the history
Improve Encode.forHtmlAttribute docs
  • Loading branch information
jeremylong committed Jul 26, 2024
2 parents ad296f2 + 351e999 commit 58bd93d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/org/owasp/encoder/Encode.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.forHtmlAttribute(unsafeData)%&gt;&quot; title=&#39;&lt;%=Encode.forHtmlAttribute(moreUnsafeData)%&gt;&#39; /&gt;
* </pre>
*
* <table border="0" class="memberSummary" summary="Shows the input and results of encoding">
Expand Down Expand Up @@ -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>
*
* <li>Both the single-quote character ({@code '}) and the
* double-quote character ({@code "}) are encoded so this is safe
* for HTML attributes with either enclosing character.</li>
Expand Down

0 comments on commit 58bd93d

Please sign in to comment.