def repo_name_slug(value): """Return slug of name of repository This function is called on each creation/modification of repository to prevent bad names in repo """ slug = remove_formatting(value) slug = strip_tags(slug) for c in """=[]\;'"<>,/~!@#$%^&*()+{}|: """: slug = slug.replace(c, '-') slug = recursive_replace(slug, '-') slug = collapse(slug, '-') return slug
def repo_name_slug(value): """ Return slug of name of repository This function is called on each creation/modification of repository to prevent bad names in repo """ slug = remove_formatting(value) slug = strip_tags(slug) for c in """`?=[]\;'"<>,/~!@#$%^&*()+{}|: """: slug = slug.replace(c, '-') slug = recursive_replace(slug, '-') slug = collapse(slug, '-') return slug
def _format(_html): return markdown_filter(truncate(remove_formatting(_html), length=200, whole_word=True))
def _format(_html): return truncate(remove_formatting(_html), length=200, whole_word=True)