return 0
def check_upgrade(self, other):
- if self.droplevel<=other.droplevel:
- return
if not self.is_compatible(other):
return
mods = self.compare_mods(other)
attrs = self.compare_attrs(other)
+ if self.droplevel<other.droplevel and (mods<0 or attrs<0):
+ return
+
if not other.upgrades["mods"]:
if mods>0 or (mods==0 and attrs>0):
other.upgrades["mods"] = self
self.current_item.check_upgrade(it)
elif tag=="h1":
self.in_heading = False
+ elif tag=="html":
+ for i in range(1, len(self.items)):
+ for j in range(i):
+ self.items[j].check_upgrade(self.items[i])
def handle_data(self, data):
data = data.strip()