Skip to content

Publishing 0.1.12: AI translations parse in any field order

Publishing 0.1.12 makes AI translation of posts read the model’s answer more reliably. The answer marks its title, slug and content with ---FIELD--- markers. When the markers came in another order, or in lower or mixed case, Publishing missed them and fell back to guessing from bare Markdown.

It now uses core’s shared translation parser, the same one the Projects module uses. Markers are found in any order and any case. If the slug is missing, the title and content are still taken, and an answer without markers still goes through the Markdown fallback.

Upgrading

Publishing 0.1.12 needs PhoenixKit 1.7.117 or later, where the shared parser first shipped.

Full release notes: Publishing 0.1.12

0.1.12 · 21 May 2026

PR #19 — unify the translation-response parser with core (paired with phoenix_kit 1.7.117).

Changed

  • TranslatePostWorker.parse_translated_response/1 now delegates to the shared Translation.parse_response/2 helper (the canonical ---FIELD--- parser shared with phoenix_kit_projects) instead of a hand-rolled chained-regex matcher. It tries ["title", "slug", "content"] first, retries with ["title", "content"] on missing fields, and falls back to the publishing-specific parse_markdown_response/1 salvage when no markers are present. The AI call sites, extract_content/1, and sanitize_slug/1 are untouched.
  • Bumped the phoenix_kit dependency floor to ~> 1.7.117, which is where the shared translation parser became available; the lock also picks up etcher 0.4.6, fresco 0.5.4, and req 0.5.18.

Fixed

  • Translation responses with ---FIELD--- markers in any order, or with lower/mixed-case marker names, now parse correctly instead of falling through to the bare-markdown salvage path. Covered by new regression tests for marker order-independence, case-insensitive markers, and the TITLE-only fallback.

Publishing 0.1.12. Install or update: {:phoenix_kit_publishing, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.