(text: str, max_len: int = 60)
| 114 | |
| 115 | |
| 116 | def 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 | |
| 125 | def github_auto_anchor(heading_text: str) -> str: |
no outgoing calls
no test coverage detected