|
1 | 1 | /*
|
2 |
| - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
|
25 | 25 | package javax.swing.text.html;
|
26 | 26 |
|
27 | 27 | import java.awt.font.TextAttribute;
|
28 |
| -import java.util.*; |
29 |
| -import java.net.URL; |
| 28 | +import java.io.IOException; |
| 29 | +import java.io.StringReader; |
30 | 30 | import java.net.MalformedURLException;
|
31 |
| -import java.io.*; |
32 |
| -import javax.swing.*; |
33 |
| -import javax.swing.event.*; |
34 |
| -import javax.swing.text.*; |
35 |
| -import javax.swing.undo.*; |
| 31 | +import java.net.URL; |
| 32 | +import java.util.ArrayList; |
| 33 | +import java.util.Enumeration; |
| 34 | +import java.util.HashMap; |
| 35 | +import java.util.Hashtable; |
| 36 | +import java.util.Stack; |
| 37 | +import java.util.Vector; |
| 38 | + |
| 39 | +import javax.swing.ButtonGroup; |
| 40 | +import javax.swing.DefaultButtonModel; |
| 41 | +import javax.swing.DefaultComboBoxModel; |
| 42 | +import javax.swing.DefaultListModel; |
| 43 | +import javax.swing.JToggleButton; |
| 44 | +import javax.swing.ListSelectionModel; |
| 45 | +import javax.swing.event.DocumentEvent; |
| 46 | +import javax.swing.event.EventListenerList; |
| 47 | +import javax.swing.event.UndoableEditEvent; |
| 48 | +import javax.swing.text.AbstractDocument; |
| 49 | +import javax.swing.text.AttributeSet; |
| 50 | +import javax.swing.text.BadLocationException; |
| 51 | +import javax.swing.text.DefaultEditorKit; |
| 52 | +import javax.swing.text.DefaultStyledDocument; |
| 53 | +import javax.swing.text.Document; |
| 54 | +import javax.swing.text.Element; |
| 55 | +import javax.swing.text.ElementIterator; |
| 56 | +import javax.swing.text.GapContent; |
| 57 | +import javax.swing.text.MutableAttributeSet; |
| 58 | +import javax.swing.text.PlainDocument; |
| 59 | +import javax.swing.text.SimpleAttributeSet; |
| 60 | +import javax.swing.text.StyleConstants; |
| 61 | +import javax.swing.undo.UndoableEdit; |
| 62 | + |
36 | 63 | import sun.swing.SwingUtilities2;
|
| 64 | + |
37 | 65 | import static sun.swing.SwingUtilities2.IMPLIED_CR;
|
38 | 66 |
|
39 | 67 | /**
|
@@ -2473,7 +2501,7 @@ public HTMLReader(int offset, int popDepth, int pushDepth,
|
2473 | 2501 | tagMap.put(HTML.Tag.SMALL, ca);
|
2474 | 2502 | tagMap.put(HTML.Tag.SPAN, ca);
|
2475 | 2503 | tagMap.put(HTML.Tag.STRIKE, conv);
|
2476 |
| - tagMap.put(HTML.Tag.S, ca); |
| 2504 | + tagMap.put(HTML.Tag.S, conv); |
2477 | 2505 | tagMap.put(HTML.Tag.STRONG, ca);
|
2478 | 2506 | tagMap.put(HTML.Tag.STYLE, new StyleAction());
|
2479 | 2507 | tagMap.put(HTML.Tag.SUB, conv);
|
@@ -3446,7 +3474,7 @@ public void start(HTML.Tag t, MutableAttributeSet attr) {
|
3446 | 3474 | String value = "underline";
|
3447 | 3475 | value = (v != null) ? value + "," + v.toString() : value;
|
3448 | 3476 | sheet.addCSSAttribute(charAttr, CSS.Attribute.TEXT_DECORATION, value);
|
3449 |
| - } else if (t == HTML.Tag.STRIKE) { |
| 3477 | + } else if (t == HTML.Tag.STRIKE || t == HTML.Tag.S) { |
3450 | 3478 | Object v = charAttr.getAttribute(CSS.Attribute.TEXT_DECORATION);
|
3451 | 3479 | String value = "line-through";
|
3452 | 3480 | value = (v != null) ? value + "," + v.toString() : value;
|
|
0 commit comments