def slug_sub(match):
level = match.group(<NUM_LIT:1>)<EOL>title = match.group(<NUM_LIT:2>)<EOL>slug = title.lower()<EOL>slug = re.sub(r'<STR_LIT>', '<STR_LIT:U+0020>', slug)<EOL>slug = re.sub(r'<STR_LIT>', '<STR_LIT:U+0020>', slug).strip()<EOL>slug = slug.replace('<STR_LIT:U+0020>', '<STR_LIT:->')<EOL>if slug:<EOL><INDENT>return '<STR_LIT>'.format(level, slug, title)<EOL><DEDENT>return match.group(<NUM_LIT:0>)<EOL>
Assigns id-less headers a slug that is derived from their
    titles. Slugs are generated by lower-casing the titles, stripping
    all punctuation, and converting spaces to hyphens (-).