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 _html ones produce HTML code β€” and self-closing tags are rendered like this: <hr>
  • the _xhtml ones 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: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) πŸ’…

🧚 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:

  • 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 β€” 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