Localize.Message.Formatter.Plain (Localize v0.25.0)

Copy Markdown View Source

Plain-text formatter for MF2 highlight tokens.

Concatenates every token's text and discards the class. The output equals the canonical MF2 string produced by Localize.Message.Print.to_string/1 — this property is verified in the highlighter test suite.

Summary

Functions

Concatenates the text of every token into a single string.

Functions

render(tokens)

Concatenates the text of every token into a single string.

Arguments

  • tokens is a list of t:Highlighter.token/0 tuples.

Returns

  • A plain string — the canonical MF2 message.