QuakeServer.Markup (quake_server v0.1.0)

Copy Markdown View Source

Text with FTE's markup reduced to the characters it shows, as FTE's COM_ParseFunString followed by COM_DeFunString with flags ignored: colour and style codes are dropped and a link's hidden part with them.

QuakeServer.Markup.plain("^1red ^[link\\info^]", utf8: 1)
#=> "red link"

Markup read: ^0–^9, ^&FB, ^b, ^d, ^a, ^m, ^h, ^s, ^r, ^xRGB (colours and styles, dropped), ^Uxxxx and ^{x…} (a character by number), ^[text\\info^] (a link: text stays), ^`u8:…`= (UTF-8 text), ^^ (a caret); with ezquake: true, &cRGB, &r and =`k8:…`= (KOI8 text). Any other ^ stays. A first byte of 1 or 2 (or 3 with dp_console: true) is dropped.

Options: :utf8 is FTE's com_parseutf8 (default 1): above 0 bytes are read as UTF-8 until one is not valid and characters are written as UTF-8; below 0 characters are written as ISO 8859-1; 0 reads Quake's character set, its high characters as their low halves and control characters as U+E000–U+E01F, and writes Quake's characters. A character the output cannot hold becomes ?.

Summary

Functions

The characters text shows, encoded as the :utf8 option says; see the module documentation.

Functions

plain(text, opts \\ [])

@spec plain(String.t(), keyword()) :: binary()

The characters text shows, encoded as the :utf8 option says; see the module documentation.