Using a primitive templating system, the front end generates record summaries and stores them as strings.
To display stylized NULL values within a record summary, we encode NULL with a special unicode code point and then parse the record summary later. During this later parsing stage, we sanitize the user input and then then display the whole record summary using {@html }.
We'd like to eliminate usage of {@html }
Desired behavior
When generating a record summary from a template and data, the front end does not produce a string. Instead it produces a RecordSummaryPart[], defined as follows:
Current behavior
NULL
values within a record summary, we encodeNULL
with a special unicode code point and then parse the record summary later. During this later parsing stage, we sanitize the user input and then then display the whole record summary using{@html }
.{@html }
Desired behavior
When generating a record summary from a template and data, the front end does not produce a string. Instead it produces a
RecordSummaryPart[]
, defined as follows:We have a
RichText.svelte
component which behaves as follows:We render a rich text record summary as follows:
We use similar mapping logic to render a plain text record summary.