- encode-for-pre - encodes text so it's suitable for inclusion in a HTML PRE element, or in a regular tag with HTML spacing.
- encode-for-argument does the same thing as encode-for-pre, except it also encodes quotation marks as SGML " so they can be used in HTML element attributes.
- encode-for-tt - attemps to encode the text so it can display in a TT element with proper spacing. The keyword argument
first-char-nbspcontrols whether the first character should be rendered as a non-breaking space if it is a space in the input text.
Try it online with this html encoder [broken links; source code at https://github.com/dmitryU/debian-lisp/tree/master/html-encode]