Text content components

These components validate, transform, inspect, or render text. Some components declare a text/* MIME type. Other components use the UTF-8 encoding contract without a more specific MIME type. Download a .wasm file and run it with qipx run, or combine compatible inputs and outputs with the recipe finder.

Markdown (text/markdown) #

Related tool: Markdown to HTML.

HTML (text/html) #

Transform

Syntax highlight

These components highlight matching fenced code blocks and return text/html:

Related tools: syntax highlighter and HTML accessibility tree.

JSON (application/json) #

Related tool: JSON Schema validator, with examples, conformance results and a speed comparison with ata-validator and @cfworker/json-schema.

XML (application/xml) #

  npx qipdo qip.dev -i subscriptions.opml application/xml/xml-must-be-well-formed.wasm > /dev/null

CSS (text/css) #

Related tools: CSS minifier and CSS expression calculator.

General text #

Validation #

  printf '[a-z]{2,8}(-[a-z0-9]+)*' | npx qipdo qip.dev -o lang.wasm text/i-regexp-to-wasm.wasm
  printf 'en-gb' | npx qipdo lang.wasm

The generated module looks up one table entry per input byte, so a pattern cannot make it backtrack, and it passes the strict profile, loop, and output-size checks. The compiler rejects patterns whose DFA needs more than 30,000 states or a 4 MiB table. Patterns that use \p{..} categories make much larger modules than ASCII patterns: \p{L}+\P{N} is 41 KB, or 260 KB as a table.

Related tool: regular expression validators, with ready-made patterns and a speed comparison with the browser's RegExp.

Unicode 17 #

Related tool: Unicode converter.

Text rendering #

Related tool: Open Graph image.

Programming languages #

JavaScript (text/javascript)

See the syntax highlight comparison for its output contract, Shiki oracle, and performance measurements.

C (text/x-c)

WebAssembly text (text/wat)

It assembles but does not type-check, so put the Core 2.0 validator after it:

  npx qipdo qip.dev -i text/base64-decode.wat -o base64-decode.wasm \
    text/wat/wat-to-wasm.wasm application/wasm/wasm-validate-core-2.0.wasm

On malformed text it reports the offset of the bad token and one of five failure modes: syntax, unknown or duplicate name, bad number, unsupported feature, or size limit. Input is limited to 1 MiB.

Dates #

Currency #

The locale-specific currency components accept a decimal value. A currency uniform selects the currency:

Related tool: currency formatter.

URI list (text/uri-list) #

Related tools: QR code and encode SVG as data URI.

Mermaid (text/vnd.mermaid) #

Related tool: Mermaid to Unicode box art.

CSV (text/csv) #

Related tool: component recipe finder.

Counts and examples #

Looking for other components? See image, audio, TUI, and GUI.