Skip to content

Commit 5681bbc

Browse files
committed
Make escapable= kwarg-only
1 parent a27159f commit 5681bbc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/html/parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class HTMLParser(_markupbase.ParserBase):
126126
containing respectively the named or numeric reference as the
127127
argument.
128128
"""
129+
129130
CDATA_CONTENT_ELEMENTS = ("script", "style")
130131
RCDATA_CONTENT_ELEMENTS = ("textarea", "title")
131132

@@ -167,7 +168,7 @@ def get_starttag_text(self):
167168
"""Return full source of start tag: '<...>'."""
168169
return self.__starttag_text
169170

170-
def set_cdata_mode(self, elem, escapable=False):
171+
def set_cdata_mode(self, elem, *, escapable=False):
171172
self.cdata_elem = elem.lower()
172173
self._escapable = escapable
173174
if escapable and not self.convert_charrefs:
@@ -428,7 +429,7 @@ def parse_starttag(self, i):
428429
if tag in self.CDATA_CONTENT_ELEMENTS:
429430
self.set_cdata_mode(tag)
430431
elif tag in self.RCDATA_CONTENT_ELEMENTS:
431-
self.set_cdata_mode(tag, True)
432+
self.set_cdata_mode(tag, escapable=True)
432433
return endpos
433434

434435
# Internal -- check to see if we have a complete starttag; return end

0 commit comments

Comments
 (0)