When the highlight is about one term, declaring that term is enough.
The literal highlighter accepts a list of rules, each with a text field and a className field in article data. The Writing Studio presents those as two controls: an input for the text and a pulldown of the syntax classes the theme already understands. The saved article keeps those values directly under literalHighlights. No JSON map or hand-written YAML string is required in the editor.
A literal rule matches exact characters, including when they occur inside a larger word. That is useful for a deliberately simple demonstration, but it also means the author should choose terms that make sense wherever they appear in that block. Matching is case-sensitive. Empty terms are rejected because they cannot advance the scan; duplicate terms are rejected because they would define the same match twice.
The article data stays straightforward
The example below highlights the word ready wherever it occurs in this short plain-text sample. The grammar is text, so the code block does not invoke a PEG scanner. The class name comes from the same class list used by the authoring pulldown. This is the form the article model stores after the author chooses a term and a class.
transition: pending -> ready
next state: ready
The implementation searches for the earliest next occurrence among the rules. If two terms begin at the same character, it chooses the longer term. It emits preceding text through the normal HTML text escaper, wraps the selected occurrence in a span with the declared class, then continues after that occurrence. This produces non-overlapping matches and keeps characters such as angle brackets from becoming markup.
Literal highlighting takes precedence over grammar highlighting for that block. It is a useful direct tool when selected substrings are the intended meaning. If the goal is to distinguish every keyword, string, identifier, and operator in a language, a PEG grammar is the better fit. Both paths use the same component boundary and style slots, but they express different authoring intent.
