Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump jsoup from 1.9.2 to 1.14.2 in /org.eclipse.lemminx #1115

Merged
merged 1 commit into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion org.eclipse.lemminx/pom.xml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@
{
"name": "org.jsoup.safety.Cleaner",
"fields": [{
"name": "whitelist"
"name": "safelist"
}]
},
{
Expand Down