CitedText

Molecule

Answer text with its [n] markers turned into CitationChip chips, drawn with the same DOM as kui-react. A marker whose number matches no evidence row becomes a dropped chip, so the reader sees that the claim is unsupported instead of a link that goes nowhere. A marker matches an evidence item by its `index` (default: position + 1). The text is escaped; the paragraph carries no whitespace of its own.

In answer text

Preview

Checkout errors started after payments 4.12.0 was rolled out [3]. The failures are gateway timeouts [1][2], and the error ratio rose above 3 % [4]. The database was the bottleneck [7].

Code
<%- include('modules/ui/CitedText', { text: answer, evidence: evidence }) %>

Another prefix and messages

Preview

Latency rose [2] after the change [1]; nothing explains [8].

Code
<%- include('modules/ui/CitedText', { text: answer, evidence: evidence, idPrefix: 'ai', messages: { citation: 'Source {index} : {title}' } }) %>
Source modules/ui/CitedText.ejs