Skip to content

Commit

Permalink
Bump jsoup from 1.9.2 to 1.14.2 in /org.eclipse.lemminx
Browse files Browse the repository at this point in the history
Bumps [jsoup](https://github.com/jhy/jsoup) from 1.9.2 to 1.14.2.
- [Release notes](https://github.com/jhy/jsoup/releases)
- [Changelog](https://github.com/jhy/jsoup/blob/master/CHANGES)
- [Commits](jhy/jsoup@jsoup-1.9.2...jsoup-1.14.2)

---
updated-dependencies:
- dependency-name: org.jsoup:jsoup
  dependency-type: direct:production
...

[rgrunber@redhat.com]: React to API changes in NodeTraversor, relocation
of StringUtil, and renaming of internal field
Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
  • Loading branch information
rgrunber authored and angelozerr committed Sep 21, 2021
1 parent 71b2047 commit 4233e9b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.lemminx/pom.xml
Expand Up @@ -238,7 +238,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.9.2</version>
<version>1.14.2</version>
</dependency>
<dependency>
<groupId>xml-resolver</groupId>
Expand Down
Expand Up @@ -23,7 +23,7 @@
*/
package org.eclipse.lemminx.extensions.xsd.contentmodel;

import org.jsoup.helper.StringUtil;
import org.jsoup.internal.StringUtil;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import org.jsoup.nodes.TextNode;
Expand All @@ -46,8 +46,7 @@ public class HtmlToPlainText {
*/
public String getPlainText(Element element) {
FormattingVisitor formatter = new FormattingVisitor();
NodeTraversor traversor = new NodeTraversor(formatter);
traversor.traverse(element); // walk the DOM, and call .head() and .tail() for each node
NodeTraversor.traverse(formatter, element); // walk the DOM, and call .head() and .tail() for each node

return formatter.toString();
}
Expand Down
Expand Up @@ -24,7 +24,7 @@
import com.overzealous.remark.Remark;

import org.jsoup.safety.Cleaner;
import org.jsoup.safety.Whitelist;
import org.jsoup.safety.Safelist;

/**
* Converts HTML content into Markdown equivalent.
Expand Down Expand Up @@ -57,12 +57,12 @@ private MarkdownConverter(){

Cleaner c = (Cleaner) cleanerField.get(remark);

Field whitelistField = Cleaner.class.getDeclaredField("whitelist");
whitelistField.setAccessible(true);
Field safelistField = Cleaner.class.getDeclaredField("safelist");
safelistField.setAccessible(true);

Whitelist w = (Whitelist) whitelistField.get(c);
Safelist s = (Safelist) safelistField.get(c);

w.addProtocols("a", "href", "file");
s.addProtocols("a", "href", "file");
} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
LOGGER.severe("Unable to modify jsoup to include file protocols "+ e.getMessage());
}
Expand Down
Expand Up @@ -1905,7 +1905,7 @@
{
"name": "org.jsoup.safety.Cleaner",
"fields": [{
"name": "whitelist"
"name": "safelist"
}]
},
{
Expand Down

0 comments on commit 4233e9b

Please sign in to comment.