MCPcopy
hub / github.com/qazbnm456/awesome-web-security / slugify

Function slugify

scripts/migrate.py:116–122  ·  view source on GitHub ↗
(text: str, max_len: int = 60)

Source from the content-addressed store, hash-verified

114
115
116def slugify(text: str, max_len: int = 60) -> str:
117 s = text.lower()
118 s = re.sub(r"['\"`]+", "", s)
119 s = re.sub(r"[^a-z0-9]+", "-", s)
120 s = re.sub(r"-+", "-", s).strip("-")
121 s = s[:max_len].rstrip("-")
122 return s or "entry"
123
124
125def github_auto_anchor(heading_text: str) -> str:

Callers 3

make_section_keyFunction · 0.70
parse_readmeFunction · 0.70
entry_idFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected