Skip to content

Commit

Permalink
candy-generator: Update jsoup dependency
Browse files Browse the repository at this point in the history
... and replace obsoleted methods as described in jsoup
  • Loading branch information
kohlschuetter committed Oct 14, 2023
1 parent fa2d8e4 commit 2a72a41
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion candy-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.7.2</version>
<version>1.16.1</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.log4j.Logger;
import org.jsoup.helper.StringUtil;
import org.jsweet.JSweetDefTranslatorConfig;
import org.jsweet.input.typescriptdef.ast.ArrayTypeReference;
import org.jsweet.input.typescriptdef.ast.AstNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,9 @@ public void visitTypeDeclaration(TypeDeclaration typeDeclaration) {
if (content != null) {
try {
Document doc = Jsoup.parse(content, "UTF-8");
NodeTraversor traversor;
traversor = new NodeTraversor(new MdnTableFormatGrabber(this, typeDeclaration));
traversor.traverse(doc.body());
traversor = new NodeTraversor(new MdnDefinitionListFormatGrabber(this, typeDeclaration));
traversor.traverse(doc.body());
traversor = new NodeTraversor(new MdnMainDescriptionGrabber(this, typeDeclaration));
traversor.traverse(doc.body());
NodeTraversor.traverse(new MdnTableFormatGrabber(this, typeDeclaration), doc.body());
NodeTraversor.traverse(new MdnDefinitionListFormatGrabber(this, typeDeclaration), doc.body());
NodeTraversor.traverse(new MdnMainDescriptionGrabber(this, typeDeclaration), doc.body());
} catch (Throwable t) {
context.reportError("cannot fill documentation for " + context.getTypeName(typeDeclaration),
typeDeclaration.getToken(), t);
Expand Down Expand Up @@ -165,8 +161,7 @@ public static String removeTags(String html) {

public static String removeTags(String html, String[] tagsToBeRemoved) {
StringBuilder sb = new StringBuilder();
NodeTraversor traversor = new NodeTraversor(new TagRemover(sb, tagsToBeRemoved));
traversor.traverse(Jsoup.parse(html).body());
NodeTraversor.traverse(new TagRemover(sb, tagsToBeRemoved), Jsoup.parse(html).body());
return sb.toString().replace("<p></p>", "");
}

Expand Down

0 comments on commit 2a72a41

Please sign in to comment.