/* web/js/sql-display.js — the one place that decides how generated SQL * looks on screen. * * Three layers, in order, all presentation-only: * * 1. Source of truth for COPY: Turn.sql_display || Turn.sql, verbatim. * Never read the DOM. Never run the client formatter on this string. * * 2. Source of truth for DISPLAY: formatSqlForDisplay(...). Prefers an * already-multi-line string (backend pretty_sql / hand-authored * scenario SQL) and only prettifies one-liners via the vendored * sql-formatter (T-SQL). That keeps two formatters from fighting: * sqlglot on the server, sql-formatter on the client, same visual * contract — clause-per-line — without re-flowing work the backend * already did. * * 3. Highlighting: vendored Prism. The T-SQL grammar patch * (bracketed identifiers, N'…' national strings) lives in * prism-tsql-patch.js as a classic script so it shares Prism's * realm — see that file. Failure at any layer leaves the previous * layer's text intact. * * Loaded as a plain ES module from turn.js. Prism and sql-formatter are * globals from classic