The _end_label that is called too early is caused by this:
def start_label(self, attrs):
...
taken = bool(d.get("for")) d["__taken"] = taken
and this
def _add_label(self, d):
...
if self._current_label["__taken"]: self.end_label() # be fuzzy
_add_label is called from do_input(). The label gets correctly attached to the input, but the label text remains empty due to the premature end_label() call.
The _end_label that is called too early is caused by this:
def start_label(self, attrs):
d["__taken" ] = taken
...
taken = bool(d.get("for"))
and this
def _add_label(self, d): label[" __taken" ]:
self. end_label( ) # be fuzzy
...
if self._current_
_add_label is called from do_input(). The label gets correctly attached to the input, but the label text remains empty due to the premature end_label() call.