ff054b9980
Gallery was reading the plain answer field and HTML-escaping it, showing literal `<ol>...` text where the actual share page rendered the markdown. Now selects answer_html alongside, runs it through the same sanitizer as the share-card render, and falls back to escaped plaintext for legacy rows.
19 lines
839 B
SQL
19 lines
839 B
SQL
-- 20260502173044_share_cards_answer_html.sql
|
|
--
|
|
-- Adds answer_html (nullable text) to public.share_cards so the gallery
|
|
-- /said preview can render the same marked.js-produced HTML that the
|
|
-- /share/<id> page already renders. Without this, gallery cards
|
|
-- HTML-escape the plaintext answer and show literal angle-bracket text
|
|
-- where the share page shows formatted lists, bold, code blocks, etc.
|
|
--
|
|
-- Nullable on purpose: existing rows pre-share-redesign have no rendered
|
|
-- HTML captured. The /said handler falls back to escaping the plain
|
|
-- answer field for those legacy rows.
|
|
--
|
|
-- Applied out-of-band via the Supabase Management API
|
|
-- (POST /v1/projects/<ref>/database/query). This file lands the change
|
|
-- in version control as the canonical record.
|
|
|
|
alter table public.share_cards
|
|
add column if not exists answer_html text;
|