Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit10b9010

Browse files
committed
Work in progress
--HG--branch : svgmathmlrename : python/README => python3/READMErename : python/html5-tests.patch => python3/html5-tests.patchrename : python/parse.py => python3/parse.pyrename : python/setup.py => python3/setup.pyrename : python/setup_base.py => python3/setup_base.pyrename : python/src/html5lib/__init__.py => python3/src/html5lib/__init__.pyrename : python/src/html5lib/constants.py => python3/src/html5lib/constants.pyrename : python/src/html5lib/filters/__init__.py => python3/src/html5lib/filters/__init__.pyrename : python/src/html5lib/filters/_base.py => python3/src/html5lib/filters/_base.pyrename : python/src/html5lib/filters/formfiller.py => python3/src/html5lib/filters/formfiller.pyrename : python/src/html5lib/filters/inject_meta_charset.py => python3/src/html5lib/filters/inject_meta_charset.pyrename : python/src/html5lib/filters/iso639codes.py => python3/src/html5lib/filters/iso639codes.pyrename : python/src/html5lib/filters/lint.py => python3/src/html5lib/filters/lint.pyrename : python/src/html5lib/filters/optionaltags.py => python3/src/html5lib/filters/optionaltags.pyrename : python/src/html5lib/filters/rfc2046.py => python3/src/html5lib/filters/rfc2046.pyrename : python/src/html5lib/filters/rfc3987.py => python3/src/html5lib/filters/rfc3987.pyrename : python/src/html5lib/filters/sanitizer.py => python3/src/html5lib/filters/sanitizer.pyrename : python/src/html5lib/filters/validator.py => python3/src/html5lib/filters/validator.pyrename : python/src/html5lib/filters/whitespace.py => python3/src/html5lib/filters/whitespace.pyrename : python/src/html5lib/html5parser.py => python3/src/html5lib/html5parser.pyrename : python/src/html5lib/ihatexml.py => python3/src/html5lib/ihatexml.pyrename : python/src/html5lib/inputstream.py => python3/src/html5lib/inputstream.pyrename : python/src/html5lib/liberalxmlparser.py => python3/src/html5lib/liberalxmlparser.pyrename : python/src/html5lib/sanitizer.py => python3/src/html5lib/sanitizer.pyrename : python/src/html5lib/serializer/__init__.py => python3/src/html5lib/serializer/__init__.pyrename : python/src/html5lib/serializer/htmlserializer.py => python3/src/html5lib/serializer/htmlserializer.pyrename : python/src/html5lib/serializer/xhtmlserializer.py => python3/src/html5lib/serializer/xhtmlserializer.pyrename : python/src/html5lib/tokenizer.py => python3/src/html5lib/tokenizer.pyrename : python/src/html5lib/treebuilders/__init__.py => python3/src/html5lib/treebuilders/__init__.pyrename : python/src/html5lib/treebuilders/_base.py => python3/src/html5lib/treebuilders/_base.pyrename : python/src/html5lib/treebuilders/dom.py => python3/src/html5lib/treebuilders/dom.pyrename : python/src/html5lib/treebuilders/etree.py => python3/src/html5lib/treebuilders/etree.pyrename : python/src/html5lib/treebuilders/etree_lxml.py => python3/src/html5lib/treebuilders/etree_lxml.pyrename : python/src/html5lib/treebuilders/simpletree.py => python3/src/html5lib/treebuilders/simpletree.pyrename : python/src/html5lib/treebuilders/soup.py => python3/src/html5lib/treebuilders/soup.pyrename : python/src/html5lib/treewalkers/__init__.py => python3/src/html5lib/treewalkers/__init__.pyrename : python/src/html5lib/treewalkers/_base.py => python3/src/html5lib/treewalkers/_base.pyrename : python/src/html5lib/treewalkers/dom.py => python3/src/html5lib/treewalkers/dom.pyrename : python/src/html5lib/treewalkers/etree.py => python3/src/html5lib/treewalkers/etree.pyrename : python/src/html5lib/treewalkers/genshistream.py => python3/src/html5lib/treewalkers/genshistream.pyrename : python/src/html5lib/treewalkers/lxmletree.py => python3/src/html5lib/treewalkers/lxmletree.pyrename : python/src/html5lib/treewalkers/pulldom.py => python3/src/html5lib/treewalkers/pulldom.pyrename : python/src/html5lib/treewalkers/simpletree.py => python3/src/html5lib/treewalkers/simpletree.pyrename : python/src/html5lib/treewalkers/soup.py => python3/src/html5lib/treewalkers/soup.pyrename : python/src/html5lib/utils.py => python3/src/html5lib/utils.pyrename : python/tests/README => python3/tests/READMErename : python/tests/__init__.py => python3/tests/__init__.pyrename : python/tests/mockParser.py => python3/tests/mockParser.pyrename : python/tests/performance/concatenation.py => python3/tests/performance/concatenation.pyrename : python/tests/runparsertests.py => python3/tests/runparsertests.pyrename : python/tests/runtests.py => python3/tests/runtests.pyrename : python/tests/support.py => python3/tests/support.pyrename : python/tests/test_encoding.py => python3/tests/test_encoding.pyrename : python/tests/test_formfiller.py => python3/tests/test_formfiller.pyrename : python/tests/test_lxp.py => python3/tests/test_lxp.pyrename : python/tests/test_parser.py => python3/tests/test_parser.pyrename : python/tests/test_parser2.py => python3/tests/test_parser2.pyrename : python/tests/test_sanitizer.py => python3/tests/test_sanitizer.pyrename : python/tests/test_sax.py => python3/tests/test_sax.pyrename : python/tests/test_serializer.py => python3/tests/test_serializer.pyrename : python/tests/test_stream.py => python3/tests/test_stream.pyrename : python/tests/test_tokenizer.py => python3/tests/test_tokenizer.pyrename : python/tests/test_treewalkers.py => python3/tests/test_treewalkers.pyrename : python/tests/test_validator.py => python3/tests/test_validator.pyrename : python/tests/test_whitespace_filter.py => python3/tests/test_whitespace_filter.pyrename : python/tests/us-ascii.html => python3/tests/us-ascii.htmlrename : python/tests/utf-8-bom.html => python3/tests/utf-8-bom.htmlrename : python/utils/encodings.py => python3/utils/encodings.pyrename : python/utils/extract-entities.py => python3/utils/extract-entities.pyrename : python/utils/iana_parse.py => python3/utils/iana_parse.pyrename : python/utils/package.py => python3/utils/package.pyrename : python/utils/spider.py => python3/utils/spider.pyrename : python/validate.py => python3/validate.pyextra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/branches/svgmathml%401265
1 parentb3a5385 commit10b9010

File tree

8 files changed

+723
-742
lines changed

8 files changed

+723
-742
lines changed

‎src/html5lib/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
99
import html5lib
1010
f = open("my_document.html")
11-
p = html5lib.HTMLParser()
12-
tree = p.parse(f)
11+
tree = html5lib.parse(f)
1312
"""
14-
fromhtml5parserimportHTMLParser,parse
15-
fromtreebuildersimportgetTreeBuilder
13+
print(__path__)
14+
15+
#from .html5parser import HTMLParser, parse
16+
#from treebuilders import getTreeBuilder
17+
18+
#from .liberalxmlparser import XMLParser, XHTMLParser
1619

17-
fromliberalxmlparserimportXMLParser,XHTMLParser

‎src/html5lib/constants.py

Lines changed: 506 additions & 513 deletions
Large diffs are not rendered by default.

‎src/html5lib/html5parser.py

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
try:
2-
frozenset
3-
exceptNameError:
4-
# Import from the sets module for python 2.3
5-
fromsetsimportSetasset
6-
fromsetsimportImmutableSetasfrozenset
71
importsys
82

9-
importinputstream
10-
importtokenizer
3+
from .importinputstream
4+
from .importtokenizer
115

12-
importtreebuilders
13-
fromtreebuilders._baseimportMarker
14-
fromtreebuildersimportsimpletree
6+
from .importtreebuilders
7+
from.treebuilders._baseimportMarker
8+
from.treebuildersimportsimpletree
159

16-
importutils
17-
fromconstantsimportcontentModelFlags,spaceCharacters,asciiUpper2Lower
18-
fromconstantsimportscopingElements,formattingElements,specialElements
19-
fromconstantsimportheadingElements,tableInsertModeElements
20-
fromconstantsimportcdataElements,rcdataElements,voidElements
21-
fromconstantsimporttokenTypes
10+
from .importutils
11+
12+
from .constantsimportcontentModelFlags,spaceCharacters,asciiUpper2Lower
13+
from .constantsimportscopingElements,formattingElements,specialElements
14+
from .constantsimportheadingElements,tableInsertModeElements
15+
from .constantsimportcdataElements,rcdataElements,voidElements
16+
from .constantsimporttokenTypes
2217

2318
defparse(doc,treebuilderName="simpletree",encoding=None):
2419
tb=treebuilders.getTreeBuilder(treebuilderName)
@@ -307,7 +302,7 @@ def startTagHtml(self, token):
307302
self.parser.parseError("non-html-root")
308303
# XXX Need a check here to see if the first start tag token emitted is
309304
# this token... If it's not, invoke self.parser.parseError().
310-
forattr,valueintoken["data"].iteritems():
305+
forattr,valueintoken["data"].items():
311306
ifattrnotinself.tree.openElements[0].attributes:
312307
self.tree.openElements[0].attributes[attr]=value
313308
self.parser.firstStartTag=False
@@ -821,7 +816,7 @@ def startTagBody(self, token):
821816
orself.tree.openElements[1].name!="body"):
822817
assertself.parser.innerHTML
823818
else:
824-
forattr,valueintoken["data"].iteritems():
819+
forattr,valueintoken["data"].items():
825820
ifattrnotinself.tree.openElements[1].attributes:
826821
self.tree.openElements[1].attributes[attr]=value
827822

@@ -834,7 +829,7 @@ def startTagCloseP(self, token):
834829

835830
defstartTagForm(self,token):
836831
ifself.tree.formPointer:
837-
self.parser.parseError(u"unexpected-start-tag", {"name":"form"})
832+
self.parser.parseError("unexpected-start-tag", {"name":"form"})
838833
else:
839834
ifself.tree.elementInScope("p"):
840835
self.endTagP("p")
@@ -855,7 +850,7 @@ def startTagListItem(self, token):
855850
ifi>=1:
856851
self.parser.parseError(
857852
i==1and"missing-end-tag"or"missing-end-tags",
858-
{"name":u", ".join([item.name
853+
{"name":", ".join([item.name
859854
foritem
860855
inpoppedNodes[:-1]])})
861856
break

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp