On Thu, 16 Jun 2022 21:31:45 GMT, Damon Nguyen <[email protected]> wrote:

>> Updated Parser class doc by appending to the doc regarding lack of support 
>> for HTML script tags. Adding this information to the "parse" function did 
>> not seem as consistent for formatting as adding it to the Parser class doc.
>
> Damon Nguyen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Fixed list format. Removed p.

I wonder if `<script>` is the only recognised but not fully supported.

According to the Parser code, `<script>` is the only tag the contents of which 
is treated as a comment. Other than that, your text looks correct: the tags are 
rendered as a text field with the tag name, the content is rendered as regular 
text; when non-editable, these are hidden.

src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java line 
1308:

> 1306:      *
> 1307:      * <ul>
> 1308:      * <li>When the container using HTML tags is editable:

Suggestion:

     * <li>When the container is editable:

src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java line 
1310:

> 1308:      * <li>When the container using HTML tags is editable:
> 1309:      *     <ul>
> 1310:      *         <li>Tags display the tag text as editable text 
> fields.</li>

Suggestion:

     *         <li>The tags will be displayed as editable text fields with the 
tag name.</li>

src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java line 
1312:

> 1310:      *         <li>Tags display the tag text as editable text 
> fields.</li>
> 1311:      *         <li>The content within the tags will be handled by the 
> editor as
> 1312:      *         regular text.</li>

This is not how `<script>` is handled though: the content is displayed in a 
text field. The text in the unknown tag is displayed directly.

The content of `<script>` tag is handled as if it's a comment.
<a 
href="https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/ae2504b4692a5298b5835727b04a44e1edc8a4d6/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java*L2176-L2177__;Iw!!ACWV5N9M2RV99hQ!PBMPNjkhh2ozj_1_t0_1CHvTIH4bn4bE_eM3bSkNLu9CPcnVYtUWZoSvftqHBz8qxuF-2JYw3a_6Lmtj8fcZT79FYg$";>https://github.com/openjdk/jdk/blob/ae2504b4692a5298b5835727b04a44e1edc8a4d6/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java#L2176-L2177</a>

-------------

PR: https://git.openjdk.org/jdk/pull/7446

Reply via email to