Skip to content

Commit b3a5385

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

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/html5lib/html5parser.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,6 +2022,21 @@ def endTagOther(self, token):
20222022
self.parser.phases["inSelect"].processEndTag(token)
20232023

20242024

2025+
class InForeignContentPhase(Phase):
2026+
def __init__(self, parser, tree):
2027+
Phase.__init__(self, parser, tree)
2028+
self.secondardInsertionMode = None
2029+
2030+
def processStartTag(self, token):
2031+
2032+
self.startTagHandler = utils.MethodDispatcher([
2033+
("html", self.startTagHtml)
2034+
])
2035+
self.startTagHandler.default = self.startTagOther
2036+
2037+
self.endTagHandler = utils.MethodDispatcher([("html", self.endTagHtml)])
2038+
self.endTagHandler.default = self.endTagOther
2039+
20252040
class AfterBodyPhase(Phase):
20262041
def __init__(self, parser, tree):
20272042
Phase.__init__(self, parser, tree)

src/html5lib/tokenizer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ def tagOpenState(self):
364364
elif data in asciiLetters:
365365
self.currentToken = {"type": tokenTypes["StartTag"],
366366
"name": data, "data": [],
367-
"selfClosing": False}
367+
"selfClosing": False,
368+
"selfClosingAcknowledged": False}
368369
self.state = self.states["tagName"]
369370
elif data == u">":
370371
# XXX In theory it could be something besides a tag name. But
@@ -761,7 +762,8 @@ def markupDeclarationOpenState(self):
761762
# so they can be copied directly into the bogus comment data, and only
762763
# the last character might be '>' or EOF and needs to be ungetted
763764
self.stream.unget(charStack.pop())
764-
self.currentToken = {"type": tokenTypes["Comment"], "data": u"".join(charStack)}
765+
self.currentToken = {"type": tokenTypes["Comment"],
766+
"data": u"".join(charStack)}
765767
self.state = self.states["bogusCommentContinuation"]
766768
return True
767769

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy