The trivial-sanitize Reference Manual

This is the trivial-sanitize Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sat Dec 03 23:34:16 2022 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 trivial-sanitize

clean html strings: "<a>foo</a>" → "foo"

Maintainer

cage

Author

cage

Bug Tracker

https://notabug.org/cage/trivial-sanitize/issues

License

LLGPL

Version

0.0.1

Dependencies
  • alexandria (system).
  • cl-ppcre-unicode (system).
  • cl-html5-parser (system).
  • uiop (system).
Source

trivial-sanitize.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 trivial-sanitize/trivial-sanitize.asd

Source

trivial-sanitize.asd.

Parent Component

trivial-sanitize (system).

ASDF Systems

trivial-sanitize.


3.1.2 trivial-sanitize/package.lisp

Source

trivial-sanitize.asd.

Parent Component

trivial-sanitize (system).

Packages

sanitize.


3.1.3 trivial-sanitize/sanitize.lisp

Dependency

package.lisp (file).

Source

trivial-sanitize.asd.

Parent Component

trivial-sanitize (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 sanitize

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *basic-sanitize*
Package

sanitize.

Source

sanitize.lisp.

Special Variable: *relaxed-sanitize*
Package

sanitize.

Source

sanitize.lisp.

Special Variable: *restricted-sanitize*
Package

sanitize.

Source

sanitize.lisp.

Special Variable: *self-closing-elements*
Package

sanitize.

Source

sanitize.lisp.

Special Variable: *strips-all-tags-sanitize*
Package

sanitize.

Source

sanitize.lisp.

Special Variable: *whitespace-elements*
Package

sanitize.

Source

sanitize.lisp.


5.1.2 Macros

Macro: define-rules (name &key tags attributes add-attributes compress-whitespaces protocols)
Package

sanitize.

Source

sanitize.lisp.


5.1.3 Ordinary functions

Function: sanitize (str rules &key case-insensitive-tag-match strip-comments strips-all-tags-on-malformed-html)
Package

sanitize.

Source

sanitize.lisp.


5.2 Internals


5.2.1 Constants

Constant: +root-tag+
Package

sanitize.

Source

sanitize.lisp.


5.2.2 Ordinary functions

Function: copy-node (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: copy-rules (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: copy-text-node (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: escape-for-html (string)

Escapes the characters #\<, #\>, #\’, #\", and #\& for HTML output.

Package

sanitize.

Source

sanitize.lisp.

Function: get-scheme (uri)
Package

sanitize.

Source

sanitize.lisp.

Function: make-node (&key name attrs children parent whitespace-element-p self-closing-element-p)
Package

sanitize.

Source

sanitize.lisp.

Function: make-rules (&key tags attributes add-attributes compress-whitespaces protocols)
Package

sanitize.

Source

sanitize.lisp.

Function: make-text-node (&key name attrs children parent whitespace-element-p self-closing-element-p text)
Package

sanitize.

Source

sanitize.lisp.

Function: maybe-add-attribute (rules node match-function)
Package

sanitize.

Source

sanitize.lisp.

Reader: node-attrs (instance)
Writer: (setf node-attrs) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

attrs.

Reader: node-children (instance)
Writer: (setf node-children) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

children.

Reader: node-name (instance)
Writer: (setf node-name) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

name.

Function: node-p (object)
Package

sanitize.

Source

sanitize.lisp.

Reader: node-parent (instance)
Writer: (setf node-parent) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

parent.

Function: node-root-p (node)
Package

sanitize.

Source

sanitize.lisp.

Reader: node-self-closing-element-p (instance)
Writer: (setf node-self-closing-element-p) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

self-closing-element-p.

Reader: node-whitespace-element-p (instance)
Writer: (setf node-whitespace-element-p) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

whitespace-element-p.

Function: parse (data strip-comments)
Package

sanitize.

Source

sanitize.lisp.

Function: remove-illegal-attributes (rules node match-function)
Package

sanitize.

Source

sanitize.lisp.

Function: remove-illegal-protocols (rules node match-function)
Package

sanitize.

Source

sanitize.lisp.

Function: remove-non-allowed-tag (rules node match-function)
Package

sanitize.

Source

sanitize.lisp.

Reader: rules-add-attributes (instance)
Writer: (setf rules-add-attributes) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

add-attributes.

Reader: rules-attributes (instance)
Writer: (setf rules-attributes) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

attributes.

Reader: rules-compress-whitespaces (instance)
Writer: (setf rules-compress-whitespaces) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

compress-whitespaces.

Function: rules-p (object)
Package

sanitize.

Source

sanitize.lisp.

Reader: rules-protocols (instance)
Writer: (setf rules-protocols) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

protocols.

Reader: rules-tags (instance)
Writer: (setf rules-tags) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

tags.

Function: self-closing-element-p (name)
Package

sanitize.

Source

sanitize.lisp.

Function: text-node-attrs (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: (setf text-node-attrs) (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: text-node-children (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: (setf text-node-children) (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: text-node-name (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: (setf text-node-name) (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: text-node-p (object)
Package

sanitize.

Source

sanitize.lisp.

Function: text-node-parent (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: (setf text-node-parent) (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: text-node-self-closing-element-p (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: (setf text-node-self-closing-element-p) (instance)
Package

sanitize.

Source

sanitize.lisp.

Reader: text-node-text (instance)
Writer: (setf text-node-text) (instance)
Package

sanitize.

Source

sanitize.lisp.

Target Slot

text.

Function: text-node-whitespace-element-p (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: (setf text-node-whitespace-element-p) (instance)
Package

sanitize.

Source

sanitize.lisp.

Function: tree->struct (tree &optional parent)
Package

sanitize.

Source

sanitize.lisp.

Function: tree-attributes (node)

Given a node returns the attribute part

Package

sanitize.

Source

sanitize.lisp.

Function: tree-children (node)

Return children of this nodes if exists

Package

sanitize.

Source

sanitize.lisp.

Function: tree-tag (node)

Given a node returns the tag part

Package

sanitize.

Source

sanitize.lisp.

Function: whitespace-element-p (name)
Package

sanitize.

Source

sanitize.lisp.


5.2.3 Structures

Structure: node
Package

sanitize.

Source

sanitize.lisp.

Direct superclasses

structure-object.

Direct subclasses

text-node.

Direct slots
Slot: name
Readers

node-name.

Writers

(setf node-name).

Slot: attrs
Readers

node-attrs.

Writers

(setf node-attrs).

Slot: children
Readers

node-children.

Writers

(setf node-children).

Slot: parent
Readers

node-parent.

Writers

(setf node-parent).

Slot: whitespace-element-p
Readers

node-whitespace-element-p.

Writers

(setf node-whitespace-element-p).

Slot: self-closing-element-p
Readers

node-self-closing-element-p.

Writers

(setf node-self-closing-element-p).

Structure: rules
Package

sanitize.

Source

sanitize.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: tags
Readers

rules-tags.

Writers

(setf rules-tags).

Slot: attributes
Readers

rules-attributes.

Writers

(setf rules-attributes).

Slot: add-attributes
Readers

rules-add-attributes.

Writers

(setf rules-add-attributes).

Slot: compress-whitespaces
Readers

rules-compress-whitespaces.

Writers

(setf rules-compress-whitespaces).

Slot: protocols
Readers

rules-protocols.

Writers

(setf rules-protocols).

Structure: text-node
Package

sanitize.

Source

sanitize.lisp.

Direct superclasses

node.

Direct slots
Slot: text
Readers

text-node-text.

Writers

(setf text-node-text).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
C   D   E   F   G   M   N   P   R   S   T   W  
Index Entry  Section

(
(setf node-attrs): Private ordinary functions
(setf node-children): Private ordinary functions
(setf node-name): Private ordinary functions
(setf node-parent): Private ordinary functions
(setf node-self-closing-element-p): Private ordinary functions
(setf node-whitespace-element-p): Private ordinary functions
(setf rules-add-attributes): Private ordinary functions
(setf rules-attributes): Private ordinary functions
(setf rules-compress-whitespaces): Private ordinary functions
(setf rules-protocols): Private ordinary functions
(setf rules-tags): Private ordinary functions
(setf text-node-attrs): Private ordinary functions
(setf text-node-children): Private ordinary functions
(setf text-node-name): Private ordinary functions
(setf text-node-parent): Private ordinary functions
(setf text-node-self-closing-element-p): Private ordinary functions
(setf text-node-text): Private ordinary functions
(setf text-node-whitespace-element-p): Private ordinary functions

C
copy-node: Private ordinary functions
copy-rules: Private ordinary functions
copy-text-node: Private ordinary functions

D
define-rules: Public macros

E
escape-for-html: Private ordinary functions

F
Function, (setf node-attrs): Private ordinary functions
Function, (setf node-children): Private ordinary functions
Function, (setf node-name): Private ordinary functions
Function, (setf node-parent): Private ordinary functions
Function, (setf node-self-closing-element-p): Private ordinary functions
Function, (setf node-whitespace-element-p): Private ordinary functions
Function, (setf rules-add-attributes): Private ordinary functions
Function, (setf rules-attributes): Private ordinary functions
Function, (setf rules-compress-whitespaces): Private ordinary functions
Function, (setf rules-protocols): Private ordinary functions
Function, (setf rules-tags): Private ordinary functions
Function, (setf text-node-attrs): Private ordinary functions
Function, (setf text-node-children): Private ordinary functions
Function, (setf text-node-name): Private ordinary functions
Function, (setf text-node-parent): Private ordinary functions
Function, (setf text-node-self-closing-element-p): Private ordinary functions
Function, (setf text-node-text): Private ordinary functions
Function, (setf text-node-whitespace-element-p): Private ordinary functions
Function, copy-node: Private ordinary functions
Function, copy-rules: Private ordinary functions
Function, copy-text-node: Private ordinary functions
Function, escape-for-html: Private ordinary functions
Function, get-scheme: Private ordinary functions
Function, make-node: Private ordinary functions
Function, make-rules: Private ordinary functions
Function, make-text-node: Private ordinary functions
Function, maybe-add-attribute: Private ordinary functions
Function, node-attrs: Private ordinary functions
Function, node-children: Private ordinary functions
Function, node-name: Private ordinary functions
Function, node-p: Private ordinary functions
Function, node-parent: Private ordinary functions
Function, node-root-p: Private ordinary functions
Function, node-self-closing-element-p: Private ordinary functions
Function, node-whitespace-element-p: Private ordinary functions
Function, parse: Private ordinary functions
Function, remove-illegal-attributes: Private ordinary functions
Function, remove-illegal-protocols: Private ordinary functions
Function, remove-non-allowed-tag: Private ordinary functions
Function, rules-add-attributes: Private ordinary functions
Function, rules-attributes: Private ordinary functions
Function, rules-compress-whitespaces: Private ordinary functions
Function, rules-p: Private ordinary functions
Function, rules-protocols: Private ordinary functions
Function, rules-tags: Private ordinary functions
Function, sanitize: Public ordinary functions
Function, self-closing-element-p: Private ordinary functions
Function, text-node-attrs: Private ordinary functions
Function, text-node-children: Private ordinary functions
Function, text-node-name: Private ordinary functions
Function, text-node-p: Private ordinary functions
Function, text-node-parent: Private ordinary functions
Function, text-node-self-closing-element-p: Private ordinary functions
Function, text-node-text: Private ordinary functions
Function, text-node-whitespace-element-p: Private ordinary functions
Function, tree->struct: Private ordinary functions
Function, tree-attributes: Private ordinary functions
Function, tree-children: Private ordinary functions
Function, tree-tag: Private ordinary functions
Function, whitespace-element-p: Private ordinary functions

G
get-scheme: Private ordinary functions

M
Macro, define-rules: Public macros
make-node: Private ordinary functions
make-rules: Private ordinary functions
make-text-node: Private ordinary functions
maybe-add-attribute: Private ordinary functions

N
node-attrs: Private ordinary functions
node-children: Private ordinary functions
node-name: Private ordinary functions
node-p: Private ordinary functions
node-parent: Private ordinary functions
node-root-p: Private ordinary functions
node-self-closing-element-p: Private ordinary functions
node-whitespace-element-p: Private ordinary functions

P
parse: Private ordinary functions

R
remove-illegal-attributes: Private ordinary functions
remove-illegal-protocols: Private ordinary functions
remove-non-allowed-tag: Private ordinary functions
rules-add-attributes: Private ordinary functions
rules-attributes: Private ordinary functions
rules-compress-whitespaces: Private ordinary functions
rules-p: Private ordinary functions
rules-protocols: Private ordinary functions
rules-tags: Private ordinary functions

S
sanitize: Public ordinary functions
self-closing-element-p: Private ordinary functions

T
text-node-attrs: Private ordinary functions
text-node-children: Private ordinary functions
text-node-name: Private ordinary functions
text-node-p: Private ordinary functions
text-node-parent: Private ordinary functions
text-node-self-closing-element-p: Private ordinary functions
text-node-text: Private ordinary functions
text-node-whitespace-element-p: Private ordinary functions
tree->struct: Private ordinary functions
tree-attributes: Private ordinary functions
tree-children: Private ordinary functions
tree-tag: Private ordinary functions

W
whitespace-element-p: Private ordinary functions


A.3 Variables

Jump to:   *   +  
A   C   N   P   S   T   W  
Index Entry  Section

*
*basic-sanitize*: Public special variables
*relaxed-sanitize*: Public special variables
*restricted-sanitize*: Public special variables
*self-closing-elements*: Public special variables
*strips-all-tags-sanitize*: Public special variables
*whitespace-elements*: Public special variables

+
+root-tag+: Private constants

A
add-attributes: Private structures
attributes: Private structures
attrs: Private structures

C
children: Private structures
compress-whitespaces: Private structures
Constant, +root-tag+: Private constants

N
name: Private structures

P
parent: Private structures
protocols: Private structures

S
self-closing-element-p: Private structures
Slot, add-attributes: Private structures
Slot, attributes: Private structures
Slot, attrs: Private structures
Slot, children: Private structures
Slot, compress-whitespaces: Private structures
Slot, name: Private structures
Slot, parent: Private structures
Slot, protocols: Private structures
Slot, self-closing-element-p: Private structures
Slot, tags: Private structures
Slot, text: Private structures
Slot, whitespace-element-p: Private structures
Special Variable, *basic-sanitize*: Public special variables
Special Variable, *relaxed-sanitize*: Public special variables
Special Variable, *restricted-sanitize*: Public special variables
Special Variable, *self-closing-elements*: Public special variables
Special Variable, *strips-all-tags-sanitize*: Public special variables
Special Variable, *whitespace-elements*: Public special variables

T
tags: Private structures
text: Private structures

W
whitespace-element-p: Private structures