Wiki: page slugs get a stray trailing .- suffix (title->filename normalization) #832

Closed
opened 2026-07-19 06:33:36 +00:00 by jmiller · 1 comment
Owner

Reported by: @jmiller

Component: Wiki (page name / slug handling)

Problem: Some wiki pages get a stray .- suffix appended to their stored sub_url / slug (e.g. CICD-Dashboard.-, Incident-Response.-, Rollback-Procedures.-, runbooks/Backup-Recovery.-, runbooks/15-admin-panels.-). The pages render fine, but the on-disk .md name and the API sub_url carry the trailing .-, which looks broken and complicates API automation.

Observed on: the MokoConsulting/.vault wiki (git.mokoconsulting.tech).

Key finding — it is NOT fixable by renaming via the API. Deleting the page and recreating it with a clean title (e.g. title CICD Dashboard) regenerates the same .- slug. So MokoGIT/Gitea is deriving the .- from the title/content during slugification, not merely storing a bad name. This points at the wiki title->filename normalization (the code that sanitizes a title into a .md filename / URL slug) emitting a trailing .- for certain titles.

Repro (via API):

  1. POST /repos/{o}/{r}/wiki/new with title = one of the affected names.
  2. GET /repos/{o}/{r}/wiki/pages -> the new page's sub_url ends in .-.
  3. Delete + recreate with a space-separated clean title -> .- returns.

Likely area: wiki page-name sanitization / NormalizeWikiName / the title->URL slug function (dots + trailing punctuation handling). A title containing (or normalizing to) a trailing . or a . + dash sequence appears to yield .-.

Impact: cosmetic for humans; real friction for API-driven wiki tooling (paths are unpredictable).

Asks:

  • Fix the slugifier so titles don't emit a trailing .-.
  • Provide a clean way to rename/normalize an existing page's slug via API.

Reported 2026-07-18.

**Reported by:** @jmiller **Component:** Wiki (page name / slug handling) **Problem:** Some wiki pages get a stray **`.-` suffix appended to their stored sub_url / slug** (e.g. `CICD-Dashboard.-`, `Incident-Response.-`, `Rollback-Procedures.-`, `runbooks/Backup-Recovery.-`, `runbooks/15-admin-panels.-`). The pages render fine, but the on-disk `.md` name and the API `sub_url` carry the trailing `.-`, which looks broken and complicates API automation. **Observed on:** the `MokoConsulting/.vault` wiki (git.mokoconsulting.tech). **Key finding — it is NOT fixable by renaming via the API.** Deleting the page and recreating it with a clean title (e.g. title `CICD Dashboard`) **regenerates the same `.-` slug**. So MokoGIT/Gitea is *deriving* the `.-` from the title/content during slugification, not merely storing a bad name. This points at the wiki title->filename normalization (the code that sanitizes a title into a `.md` filename / URL slug) emitting a trailing `.-` for certain titles. **Repro (via API):** 1. `POST /repos/{o}/{r}/wiki/new` with `title` = one of the affected names. 2. `GET /repos/{o}/{r}/wiki/pages` -> the new page's `sub_url` ends in `.-`. 3. Delete + recreate with a space-separated clean title -> `.-` returns. **Likely area:** wiki page-name sanitization / `NormalizeWikiName` / the title->URL slug function (dots + trailing punctuation handling). A title containing (or normalizing to) a trailing `.` or a `.` + dash sequence appears to yield `.-`. **Impact:** cosmetic for humans; real friction for API-driven wiki tooling (paths are unpredictable). **Asks:** - Fix the slugifier so titles don't emit a trailing `.-`. - Provide a clean way to rename/normalize an existing page's slug via API. _Reported 2026-07-18._
jmiller added the tech-debt label 2026-07-19 06:33:37 +00:00
Author
Owner

Branch created: feature/832-wiki-page-slugs-get-a-stray-trailing-suf

git fetch origin
git checkout feature/832-wiki-page-slugs-get-a-stray-trailing-suf
Branch created: [`feature/832-wiki-page-slugs-get-a-stray-trailing-suf`](https://git.mokoconsulting.tech/MokoConsulting/MokoGIT/src/branch/feature/832-wiki-page-slugs-get-a-stray-trailing-suf) ```bash git fetch origin git checkout feature/832-wiki-page-slugs-get-a-stray-trailing-suf ```
Sign in to join this conversation.