SOLDOUT_RENDERERS(3)
β¨ SOLDOUT_RENDERERS β¨
okay bestie, welcome to soldout_renderers(3) β it's a Library Functions Manual page, and it's literally the whole vibe of turning markdown into HTML. it's giving renderer central π
we're talking soldout_renderers, lus_attr_escape, and lus_body_escape β various markdown to HTML renderers for soldout. no cap. π
πΈ 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 π
so lus_attr_escape() and lus_body_escape() are the escape girlies β they escape all the problematic characters in (X)HTML. π«Ά
lus_attr_escape()escapes these bad boys:<,>,&,".lus_body_escape()escapes this crew:<,>,&.
both of them take a string str of the length len and dump the output into the ob buffer. that's it, that's the whole job, and they ate. π₯
all the provided renderers come in two flavors, bestie:
- the
_htmlones produce HTML code β and self-closing tags are rendered like this:<hr> - the
_xhtmlones produce XHTML code β and self-closing tags look like<hr />
π¦ the mkd renderers π¦
mkd_html and mkd_xhtml implement standard markdown to (X)HTML translation without any extension. just the classics, no add-ons, clean, simple, iconic. β
π the discount renderers π
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 the extensions included in these renderers:
- image size specification, by appending
"=(width)x(height)"to the link π - pseudo-protocols in links:
abbr:descriptionfor<abbr title="description">...</abbr>class:namefor<span class="name">...</span>id:namefor<span id="name">...</span>raw:textfor verbatim unprocessed text inclusion π
- class blocks: blockquotes beginning with
%class%will be rendered as adivof the given class(es) π
π§ the nat renderers π§
nat_html and nat_xhtml implement, on top of the Discount extensions, Natasha's own extensions. here is a list of these extensions:
idattribute for headers, using the syntaxid#Header textπclassattribute 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 β and yes there are 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 the emphasis-like delimiter|β¨
π RETURN VALUES π
ngl, this part is short and sweet: lus_attr_escape() and lus_body_escape() functions do not return a value. that's it. nothing to see here, they just do their thing and go π
π SEE ALSO π
go read those too, bestie, it's a whole connected universe πΈ
π AUTHORS π
the soldout library was written by Natasha "Kerensikova" Porte <natacha@instinctive.eu>. π
the manual page was originally written by Massimo Manghi <mxmanghi@apache.org>, and rewritten to mdoc format by Svyatoslav Mishyn <juef@openmailbox.org>.
and that's the whole page, babe π«Ά this Debian-flavored edition of the manual page is dated April 13, 2016 β a certified classic, fr fr. main character energy only. slay, stay escaped, and don't forget to close your tags π β¨
π¦ where this page comes from
- debian bookworm: libsoldout-dev 1.4-5 Β· ISC
- debian trixie: libsoldout-dev 1.4-7+b1 Β· ISC
- ubuntu jammy: libsoldout-dev 1.4-5 Β· ISC
- ubuntu noble: libsoldout-dev 1.4-5build1 Β· ISC
- ubuntu questing: libsoldout-dev 1.4-7
- ubuntu resolute: libsoldout-dev 1.4-7build1 Β· ISC
- ubuntu stonking: libsoldout-dev 1.4-7build1 Β· ISC
- Copyright (c) 2009 - 2016 Natacha PortΓ© <natacha@instinctive.eu>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms