remove html outline contentview, fix #2572

This commit is contained in:
Maximilian Hils 2017-09-14 15:11:24 -07:00
parent 9716b3dab5
commit 289ddfe988
4 changed files with 1 additions and 29 deletions

View File

@ -22,7 +22,7 @@ from mitmproxy import exceptions
from mitmproxy.net import http
from mitmproxy.utils import strutils
from . import (
auto, raw, hex, json, xml_html, html_outline, wbxml, javascript, css,
auto, raw, hex, json, xml_html, wbxml, javascript, css,
urlencoded, multipart, image, query, protobuf
)
from .base import View, VIEW_CUTOFF, KEY_MAX, format_text, format_dict, TViewResult
@ -168,7 +168,6 @@ add(hex.ViewHex())
add(json.ViewJSON())
add(xml_html.ViewXmlHtml())
add(wbxml.ViewWBXML())
add(html_outline.ViewHTMLOutline())
add(javascript.ViewJavaScript())
add(css.ViewCSS())
add(urlencoded.ViewURLEncoded())

View File

@ -1,17 +0,0 @@
import html2text
from mitmproxy.contentviews import base
class ViewHTMLOutline(base.View):
name = "HTML Outline"
prompt = ("html outline", "o")
content_types = ["text/html"]
def __call__(self, data, **metadata):
data = data.decode("utf-8", "replace")
h = html2text.HTML2Text(baseurl="")
h.ignore_images = True
h.body_width = 0
outline = h.handle(data)
return "HTML Outline", base.format_text(outline)

View File

@ -66,7 +66,6 @@ setup(
"click>=6.2, <7",
"cryptography>=2.0,<2.1",
"h2>=3.0, <4",
"html2text>=2016.1.8, <=2016.9.19",
"hyperframe>=5.0, <6",
"kaitaistruct>=0.7, <0.8",
"ldap3>=2.2.0, <2.4",

View File

@ -1,9 +0,0 @@
from mitmproxy.contentviews import html_outline
from test.mitmproxy.contentviews import full_eval
def test_view_html_outline():
v = full_eval(html_outline.ViewHTMLOutline())
s = b"<html><br><br></br><p>one</p></html>"
assert v(s)
assert v(b'\xfe')