---
name: "soldout_renderers"
section: "3"
platform: "linux"
package: "libsoldout-dev"
version: "1.4-7+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/soldout_renderers"
---

# soldout\_renderers(3)

various markdown to HTML renderers for soldout

## NAME

**soldout\_renderers**, **lus\_attr\_escape**, **lus\_body\_escape** – various markdown to HTML renderers for soldout

## SYNOPSIS

**#include \<renderers.h\>**

*void*\

**lus\_attr\_escape**(*struct buf \*ob*, *const char \*str*, *size\_t len*);

*void*\

**lus\_body\_escape**(*struct buf \*ob*, *const char \*str*, *size\_t len*);

*extern* *const* *struct* *mkd\_renderer* *mkd\_html;* *extern* *const* *struct* *mkd\_renderer* *mkd\_xhtml;* *extern* *const* *struct* *mkd\_renderer* *discount\_html;* *extern* *const* *struct* *mkd\_renderer* *discount\_xhtml;* *extern* *const* *struct* *mkd\_renderer* *nat\_html;* *extern* *const* *struct* *mkd\_renderer* *nat\_xhtml;*

## DESCRIPTION

The **lus\_attr\_escape**() and **lus\_body\_escape**() functions escape all problematic characters in (X)HTML: ‘\<’, ‘\>’, ‘&’, ‘"’; and ‘\<’, ‘\>’, ‘&’ respectively. They accept a string *str* of the length *len* and output into *ob* buffer.

All provided renderers come with two flavors, *\_html* producing HTML code (self-closing tags are rendered like this: \<hr\>), and *\_xhtml* producing XHTML code (self-closing tags like \<hr /\>).

*mkd\_html* and *mkd\_xhtml* implement standard markdown to (X)HTML translation without any extension.

*discount\_html* and *discount\_xhtml* implement on top of the standard markdown some of the extensions found in Discount and PHP-Markdown-like tables. Here is a list of all extensions included in these renderers:

- image size specification, by appending "=(width)x(height)" to the link

- pseudo-protocols in links:

  - abbr:description for \<abbr title="description"\>...\</abbr\>

  - class:name for \<span class="name"\>...\</span\>

  - id:name for \<span id="name"\>...\</span\>

  - raw:text for verbatim unprocessed text inclusion

- class blocks: blockquotes beginning with %class% will be rendered as a div of the given class(es)

*nat\_html* and *nat\_xhtml* implement on top of Discount extensions and Natasha's own extensions. Here is a list of these extensions:

- id attribute for headers, using the syntax id#Header text

- class attribute for paragraphs, by putting class name(s) between parenthesis at the very beginning of the paragraph

- \<ins\> and \<del\> spans, using respectively ++ and -- as delimiters (with emphasis-like restrictions, i.e. an opening delimiter cannot be followed by a whitespace, and a closing delimiter cannot be preceded by a whitespace)

- plain \<span\> without attribute, using emphasis-like delimiter \|

## RETURN VALUES

The **lus\_attr\_escape**() and **lus\_body\_escape**() functions do not return a value.

## SEE ALSO

[soldout(3)](/soldout/3.md), [soldout\_buffer(3)](/soldout_buffer/3.md), [soldout\_markdown(3)](/soldout_markdown/3.md)

## AUTHORS

The **soldout** library was written by Natasha "Kerensikova" Porte ⟨*natacha@instinctive.eu*⟩. Manual page was originally written by Massimo Manghi ⟨*mxmanghi@apache.org*⟩, and rewritten to mdoc format by Svyatoslav Mishyn ⟨*juef@openmailbox.org*⟩.
