diff --git a/.idea/libraries/com_googlecode_owasp_java_html_sanitizer_owasp_java_html_sanitizer_20180219_1.xml b/.idea/libraries/com_googlecode_owasp_java_html_sanitizer_owasp_java_html_sanitizer_20180219_1.xml deleted file mode 100644 index 4c123b542d39..000000000000 --- a/.idea/libraries/com_googlecode_owasp_java_html_sanitizer_owasp_java_html_sanitizer_20180219_1.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/python/rest/intellij.reStructuredText.iml b/python/rest/intellij.reStructuredText.iml index 44ba7bcca1e5..0cf073dab5ba 100644 --- a/python/rest/intellij.reStructuredText.iml +++ b/python/rest/intellij.reStructuredText.iml @@ -15,6 +15,5 @@ - \ No newline at end of file diff --git a/python/rest/src/com/jetbrains/rest/editor/RestSwingHtmlPanel.java b/python/rest/src/com/jetbrains/rest/editor/RestSwingHtmlPanel.java index d11d8d77241c..dff19e856ff1 100644 --- a/python/rest/src/com/jetbrains/rest/editor/RestSwingHtmlPanel.java +++ b/python/rest/src/com/jetbrains/rest/editor/RestSwingHtmlPanel.java @@ -1,52 +1,14 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.rest.editor; -import com.intellij.openapi.util.NotNullLazyValue; import com.intellij.ui.components.JBScrollPane; import org.jetbrains.annotations.NotNull; -import org.owasp.html.HtmlPolicyBuilder; -import org.owasp.html.PolicyFactory; -import org.owasp.html.Sanitizers; import javax.swing.*; import javax.swing.text.html.HTMLEditorKit; public class RestSwingHtmlPanel implements RestPreviewPanel { - final static NotNullLazyValue SANITIZER_VALUE = new NotNullLazyValue() { - @NotNull - @Override - protected PolicyFactory compute() { - return Sanitizers.BLOCKS - .and(Sanitizers.FORMATTING) - .and(new HtmlPolicyBuilder() - .allowUrlProtocols("file", "http", "https").allowElements("img") - .allowAttributes("alt", "src", "title").onElements("img") - .allowAttributes("border", "height", "width").onElements("img") - .toFactory()) - .and(new HtmlPolicyBuilder() - .allowUrlProtocols("file", "http", "https", "mailto").allowElements("a") - .allowAttributes("href", "title").onElements("a") - .toFactory()) - .and(new HtmlPolicyBuilder() - .allowStandardUrlProtocols() - .allowElements("table", "tr", "td", "th", "caption", "thead", "tbody", "tfoot") - .allowAttributes("summary").onElements("table") - .allowAttributes("align", "valign") - .onElements("table", "tr", "td", "th", "thead", "tbody", "tfoot") - .allowTextIn("table") - .toFactory()) - .and(new HtmlPolicyBuilder() - .allowStandardUrlProtocols() - .allowElements("pre", "span") - .toFactory()) - .and(new HtmlPolicyBuilder() - .allowElements("code", "tr") - .allowAttributes("class").onElements("code", "tr") - .toFactory()); - } - }; - private final JTextPane myPane; private final JScrollPane myScrollPane; @@ -58,7 +20,6 @@ public class RestSwingHtmlPanel implements RestPreviewPanel { @Override public void setHtml(@NotNull String html) { - html = "" + SANITIZER_VALUE.getValue().sanitize(html) + ""; myPane.setText(html); }