Replace multiple underscores with single underscore in anchor slugs.
This commit is contained in:
parent
3d93608bff
commit
082040beac
1 changed files with 1 additions and 0 deletions
|
@ -402,6 +402,7 @@ def slugify(text):
|
|||
text = text.replace(' ', '_')
|
||||
text = [c for c in text if c in SLUG_CHARACTERS]
|
||||
text = ''.join(text)
|
||||
text = re.sub(r'_{2,}', '_', text)
|
||||
return text
|
||||
|
||||
def uniqify_slug(slug, used_slugs):
|
||||
|
|
Loading…
Reference in a new issue