_generate_html_toc adds libmarkdown.MKD_TOC to .flags, so differing from the other ones that call _get_compiled_doc. I am not sure what the effect of changing .flags is.
Since the memoized value is invalidated want to
if self.flags &libmarkdown.MKD_TOC ==0: delattr(self, '_doc')
_generate_html_tocaddslibmarkdown.MKD_TOCto.flags, so differing from the other ones that call_get_compiled_doc. I am not sure what the effect of changing.flagsis.Since the memoized value is invalidated want to