Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sayanarijit committed Feb 12, 2024
1 parent f20708f commit 377171d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tiptapy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ class IFrameParser(HTMLParser):

def __init__(self):
super().__init__()
self.reading_iframe = False
self.is_reading_iframe = False
self.data = []

def handle_starttag(self, tag, attrs):
if self.reading_iframe:
if self.is_reading_iframe:
raise ValueError("Only one iframe tag is allowed")

if tag != self.allowed_tag:
Expand All @@ -62,16 +62,16 @@ def handle_starttag(self, tag, attrs):
[k if v is None else f'{escape(k)}="{escape(v)}"' for k, v in attrs]
)
self.data.append(f"<{tag} {_attrs}>")
self.reading_iframe = True
self.is_reading_iframe = True

def handle_endtag(self, tag):
if tag != self.allowed_tag:
return
self.data.append(f"</{tag}>")
self.reading_iframe = False
self.is_reading_iframe = False

def handle_data(self, data):
if self.reading_iframe:
if self.is_reading_iframe:
self.data.append(data)

def result(self) -> str:
Expand Down

0 comments on commit 377171d

Please sign in to comment.