% (n, self._run_span_gamut(match.group(1)), n)
_atx_h_re = re.compile(r'''
- ^(\#{1,6}) # \1 = string of #'s
+ ^([\#=]{1,6}) # \1 = string of #'s
[ \t]*
(.+?) # \2 = Header text
[ \t]*
(?<!\\) # ensure not an escaped trailing '#'
- \#* # optional closing #'s (not counted)
+ [\#=]* # optional closing #'s (not counted)
\n+
''', re.X | re.M)
def _atx_h_sub(self, match):