# CMS conversion example

This synthetic fixture accompanies the article about moving an AI draft into a CMS. It uses official Ghost conversion libraries locally; it does not exercise a hosted Ghost API, editor or theme.

## Compare

- [Original preview](./original-preview.html)
- [Converted preview](./converted-preview.html)
- [Repaired preview](./repaired-preview.html)
- [Original HTML](./source.html)
- [Repaired input](./repaired-source.html)
- [Machine-readable result](./result.json)

The converted heading receives a new ID while its fragment link still points to the old one. Only the heading is wrapped in Ghost's documented HTML-card markers for the repair. The nested list, table, code, figure and relative href survive all comparisons.

The relative publishing link is a sample address. Its destination is not supplied; the test compares how the URL resolves at a declared base. The three previews use a simple test stylesheet, not a Ghost theme.

## Reproduce

Download this directory's `package.json`, `package-lock.json`, `run.cjs`, `source.html`, `baseline-source.html` and `workflow.svg` into one folder. Use Node 22.22.2 or newer in the Node 22 line, or Node 24.15.0 or newer in the Node 24 line, as required by the pinned Ghost packages.

```sh
npm ci
node run.cjs ./result
```

The script writes converted Lexical, rendered HTML, preview pages and `result.json`. It asserts the expected broken anchor and repaired target, then checks the other structures. Browser rendering, clipboard behavior and hosted CMS behavior need separate checks.
