mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-18 03:19:51 +03:00
caec078892
Replace `@mdx-js/mdx`'s `evaluate`/`run` (which depends on `'unsafe-eval'` in the page CSP) with a pure `unified`/remark/rehype pipeline. URL-mode content now arrives from the build-time `mdx-plugin` as pre-rendered HTML and is stamped through a Trusted Types passthrough policy (`CompiledMarkdownTrustPolicy`) so admin-side custom elements like `<ak-alert>` and `<ak-md-a>` survive. Content-mode (admin-supplied markdown) is compiled in-browser via `compileRuntimeMarkdown` and routed through the existing `BrandedHTMLPolicy` (DOMPurify). `<ak-md-a>` replaces the React `MDXAnchor`/`MDXWrapper` pair: a tiny Lit custom element with `display: contents` that intercepts in-doc fragment clicks for shadow-root scrolling. The remark plugins gain `caution` and `tip` admonition types and promote `:::name[Title]` directive labels to `<strong>`. `one-dark.css` learns `:host` so syntax-highlighted code blocks inherit the palette inside `<ak-mdx>`'s shadow tree. Removes `@mdx-js/mdx`, `react`, `react-dom`, `rehype-mermaid`, and `remark-mdx-frontmatter`. Adds `unified`, `remark-parse`, `remark-rehype`, and `mdast-util-to-string`. Co-Authored-By: Agent <279763771+playpen-agent@users.noreply.github.com>