Files
mattermost/docs
Eva SarafianouandCursor 9e386cb993 docs: resolve raw HTML link and image paths through useBaseUrl (#38958)
* docs: resolve raw HTML link and image paths through useBaseUrl

Docusaurus prepends `baseUrl` to markdown-syntax links (`[text](/path)`) but
never to site-absolute paths written in raw HTML/JSX attributes. Those values
ship verbatim, which is correct only while `baseUrl` is `/`.

Convert the 221 raw `<a href="/...">` anchors across 22 files under docs/main
and the 3 raw `<img src="/img/...">` tags in docs/develop to
`useBaseUrl('/...')`, matching how images in the same table rows already
resolve their paths. Link targets, link text and table structure are unchanged.

Add scripts/check-base-url-attrs.mjs and run it as the first step of
`prebuild` so the build fails fast on any new occurrence.

* docs(site): match CommonMark fence closing in baseUrl attr check

Toggle on any fence-like line could exit a block early; track the
opening marker and only close with the same character of sufficient length.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(site): also flag JSX string-literal href/src in baseUrl check

Quoted attributes alone miss href={"/path"} / src={'/path'}, which
bypass baseUrl the same way. Scan both forms through one validation path.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-04 11:01:13 +02:00
..