Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a4bb61d

Browse files
committedJun 28, 2024
JavadocTransformer: add support for javadoc 17
1 parent faae500 commit a4bb61d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎native/java/org/jpype/javadoc/JavadocTransformer.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ void handleDescription(Node node, Workspace data)
9797
{
9898
data.hr = true;
9999
parent.removeChild(node);
100-
} else if (name.equals("pre"))
100+
} else if (name.equals("pre") || // Javadoc pre-17
101+
(name.equals("div") && e.getAttribute("class").equals("type-signature"))) // Javadoc 17+
101102
{
102103
DomUtilities.removeWhitespace(node);
103104
doc.renameNode(node, null, "signature");
@@ -124,10 +125,11 @@ void handleMembers(Node node, Workspace ws)
124125
String name = e.getTagName();
125126
Document doc = e.getOwnerDocument();
126127

127-
if (name.equals("h4"))
128+
if (name.equals("h4") || name.equals("h3")) // h4 for Javadoc pre-17, h3 for Javadoc 17+
128129
{
129130
doc.renameNode(node, null, "title");
130-
} else if (name.equals("pre"))
131+
} else if (name.equals("pre") || // Javadoc pre-17
132+
(name.equals("div") && (e.getAttribute("class").equals("member-signature")))) // Javadoc 17+
131133
{
132134
doc.renameNode(node, null, "signature");
133135
DomUtilities.traverseDFS(node, this::pass1, Node.ELEMENT_NODE, ws);

0 commit comments

Comments
 (0)
Please sign in to comment.