The sanitize Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The sanitize Reference Manual

This is the sanitize Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:22:07 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

.. -*- rst -*-

CL-SANITIZE
===========

cl-sanitize is a whitelist-based HTML sanitizer. Given a list of acceptable
elements and attributes, cl-sanitize will remove all unacceptable HTML from
a string.

cl-sanitize is a Common Lisp port of `Sanitize`_.

Requires
========

* `cl-libxml2`_

.. _Sanitize: https://github.com/rgrove/sanitize
.. _cl-libxml2: http://code.google.com/p/cl-libxml2/


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 sanitize

Dependency

cl-libxml2

Source

sanitize.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Next: , Previous: , Up: Modules   [Contents][Index]

3.1 sanitize/src

Parent

sanitize (system)

Location

src/

Components

Previous: , Up: Modules   [Contents][Index]

3.2 sanitize/src/modes

Dependency

mode.lisp (file)

Parent

src (module)

Location

src/modes/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

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


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 sanitize.asd

Location

sanitize.asd

Systems

sanitize (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 sanitize/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

sanitize


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 sanitize/src/mode.lisp

Dependency

package.lisp (file)

Parent

src (module)

Location

src/mode.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.4 sanitize/src/clean.lisp

Dependency

mode.lisp (file)

Parent

src (module)

Location

src/clean.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.5 sanitize/src/modes/basic.lisp

Parent

modes (module)

Location

src/modes/basic.lisp

Exported Definitions

+basic+ (special variable)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.6 sanitize/src/modes/relaxed.lisp

Parent

modes (module)

Location

src/modes/relaxed.lisp

Exported Definitions

+relaxed+ (special variable)


Previous: , Up: Lisp files   [Contents][Index]

4.1.7 sanitize/src/modes/restricted.lisp

Parent

modes (module)

Location

src/modes/restricted.lisp

Exported Definitions

+restricted+ (special variable)


Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 sanitize

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Special variables

Special Variable: +basic+
Package

sanitize

Source

basic.lisp (file)

Special Variable: +default+
Package

sanitize

Source

mode.lisp (file)

Special Variable: +relaxed+
Package

sanitize

Source

relaxed.lisp (file)

Special Variable: +restricted+
Package

sanitize

Source

restricted.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Macros

Macro: define-sanitize-mode NAME &key ALLOW-COMMENTS ADD-ATTRIBUTES ATTRIBUTES ELEMENTS PROTOCOLS WHITESPACE-ELEMENTS REMOVE-ELEMENTS
Package

sanitize

Source

mode.lisp (file)

Macro: with-clean-fragment (FRAGMENT HTML MODE) &body BODY
Package

sanitize

Source

clean.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.3 Functions

Function: clean HTML &optional MODE

Return sanitize copy of HTML

Package

sanitize

Source

clean.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.4 Classes

Class: sanitize-mode ()
Package

sanitize

Source

mode.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: allow-comments
Initargs

:allow-comments

Readers

mode-allow-comments (generic function)

Slot: add-attributes
Initargs

:add-attributes

Readers

mode-add-attributes (generic function)

Slot: attributes
Initargs

:attributes

Readers

mode-attributes (generic function)

Slot: elements
Initargs

:elements

Readers

mode-elements (generic function)

Slot: protocols
Initargs

:protocols

Readers

mode-protocols (generic function)

Slot: whitespace-elements
Initargs

:whitespace-elements

Readers

mode-whitespace-elements (generic function)

Slot: remove-elements
Initargs

:remove-elements

Readers

mode-remove-elements (generic function)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Functions

Function: attribute-allowed-p MODE TAGNAME ATTRNAME
Package

sanitize

Source

mode.lisp (file)

Function: clean-element ELEMENT MODE &optional TAGNAME
Package

sanitize

Source

clean.lisp (file)

Function: clean-node NODE MODE
Package

sanitize

Source

clean.lisp (file)

Function: element-additional-attributes MODE TAGNAME
Package

sanitize

Source

mode.lisp (file)

Function: element-allowed-p MODE TAGNAME
Package

sanitize

Source

mode.lisp (file)

Function: element-protocols MODE TAGNAME
Package

sanitize

Source

mode.lisp (file)

Function: element-removed-p MODE TAGNAME
Package

sanitize

Source

mode.lisp (file)

Function: whitespace-element-p MODE TAGNAME
Package

sanitize

Source

mode.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Generic functions

Generic Function: mode-add-attributes OBJECT
Package

sanitize

Methods
Method: mode-add-attributes (SANITIZE-MODE sanitize-mode)

automatically generated reader method

Source

mode.lisp (file)

Generic Function: mode-allow-comments OBJECT
Package

sanitize

Methods
Method: mode-allow-comments (SANITIZE-MODE sanitize-mode)

automatically generated reader method

Source

mode.lisp (file)

Generic Function: mode-attributes OBJECT
Package

sanitize

Methods
Method: mode-attributes (SANITIZE-MODE sanitize-mode)

automatically generated reader method

Source

mode.lisp (file)

Generic Function: mode-elements OBJECT
Package

sanitize

Methods
Method: mode-elements (SANITIZE-MODE sanitize-mode)

automatically generated reader method

Source

mode.lisp (file)

Generic Function: mode-protocols OBJECT
Package

sanitize

Methods
Method: mode-protocols (SANITIZE-MODE sanitize-mode)

automatically generated reader method

Source

mode.lisp (file)

Generic Function: mode-remove-elements OBJECT
Package

sanitize

Methods
Method: mode-remove-elements (SANITIZE-MODE sanitize-mode)

automatically generated reader method

Source

mode.lisp (file)

Generic Function: mode-whitespace-elements OBJECT
Package

sanitize

Methods
Method: mode-whitespace-elements (SANITIZE-MODE sanitize-mode)

automatically generated reader method

Source

mode.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M   S  
Index Entry  Section

F
File, Lisp, sanitize.asd: The sanitize<dot>asd file
File, Lisp, sanitize/src/clean.lisp: The sanitize/src/clean<dot>lisp file
File, Lisp, sanitize/src/mode.lisp: The sanitize/src/mode<dot>lisp file
File, Lisp, sanitize/src/modes/basic.lisp: The sanitize/src/modes/basic<dot>lisp file
File, Lisp, sanitize/src/modes/relaxed.lisp: The sanitize/src/modes/relaxed<dot>lisp file
File, Lisp, sanitize/src/modes/restricted.lisp: The sanitize/src/modes/restricted<dot>lisp file
File, Lisp, sanitize/src/package.lisp: The sanitize/src/package<dot>lisp file

L
Lisp File, sanitize.asd: The sanitize<dot>asd file
Lisp File, sanitize/src/clean.lisp: The sanitize/src/clean<dot>lisp file
Lisp File, sanitize/src/mode.lisp: The sanitize/src/mode<dot>lisp file
Lisp File, sanitize/src/modes/basic.lisp: The sanitize/src/modes/basic<dot>lisp file
Lisp File, sanitize/src/modes/relaxed.lisp: The sanitize/src/modes/relaxed<dot>lisp file
Lisp File, sanitize/src/modes/restricted.lisp: The sanitize/src/modes/restricted<dot>lisp file
Lisp File, sanitize/src/package.lisp: The sanitize/src/package<dot>lisp file

M
Module, sanitize/src: The sanitize/src module
Module, sanitize/src/modes: The sanitize/src/modes module

S
sanitize.asd: The sanitize<dot>asd file
sanitize/src: The sanitize/src module
sanitize/src/clean.lisp: The sanitize/src/clean<dot>lisp file
sanitize/src/mode.lisp: The sanitize/src/mode<dot>lisp file
sanitize/src/modes: The sanitize/src/modes module
sanitize/src/modes/basic.lisp: The sanitize/src/modes/basic<dot>lisp file
sanitize/src/modes/relaxed.lisp: The sanitize/src/modes/relaxed<dot>lisp file
sanitize/src/modes/restricted.lisp: The sanitize/src/modes/restricted<dot>lisp file
sanitize/src/package.lisp: The sanitize/src/package<dot>lisp file

Jump to:   F   L   M   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   A   C   D   E   F   G   M   W  
Index Entry  Section

A
attribute-allowed-p: Internal functions

C
clean: Exported functions
clean-element: Internal functions
clean-node: Internal functions

D
define-sanitize-mode: Exported macros

E
element-additional-attributes: Internal functions
element-allowed-p: Internal functions
element-protocols: Internal functions
element-removed-p: Internal functions

F
Function, attribute-allowed-p: Internal functions
Function, clean: Exported functions
Function, clean-element: Internal functions
Function, clean-node: Internal functions
Function, element-additional-attributes: Internal functions
Function, element-allowed-p: Internal functions
Function, element-protocols: Internal functions
Function, element-removed-p: Internal functions
Function, whitespace-element-p: Internal functions

G
Generic Function, mode-add-attributes: Internal generic functions
Generic Function, mode-allow-comments: Internal generic functions
Generic Function, mode-attributes: Internal generic functions
Generic Function, mode-elements: Internal generic functions
Generic Function, mode-protocols: Internal generic functions
Generic Function, mode-remove-elements: Internal generic functions
Generic Function, mode-whitespace-elements: Internal generic functions

M
Macro, define-sanitize-mode: Exported macros
Macro, with-clean-fragment: Exported macros
Method, mode-add-attributes: Internal generic functions
Method, mode-allow-comments: Internal generic functions
Method, mode-attributes: Internal generic functions
Method, mode-elements: Internal generic functions
Method, mode-protocols: Internal generic functions
Method, mode-remove-elements: Internal generic functions
Method, mode-whitespace-elements: Internal generic functions
mode-add-attributes: Internal generic functions
mode-add-attributes: Internal generic functions
mode-allow-comments: Internal generic functions
mode-allow-comments: Internal generic functions
mode-attributes: Internal generic functions
mode-attributes: Internal generic functions
mode-elements: Internal generic functions
mode-elements: Internal generic functions
mode-protocols: Internal generic functions
mode-protocols: Internal generic functions
mode-remove-elements: Internal generic functions
mode-remove-elements: Internal generic functions
mode-whitespace-elements: Internal generic functions
mode-whitespace-elements: Internal generic functions

W
whitespace-element-p: Internal functions
with-clean-fragment: Exported macros

Jump to:   A   C   D   E   F   G   M   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   +  
A   E   P   R   S   W  
Index Entry  Section

+
+basic+: Exported special variables
+default+: Exported special variables
+relaxed+: Exported special variables
+restricted+: Exported special variables

A
add-attributes: Exported classes
allow-comments: Exported classes
attributes: Exported classes

E
elements: Exported classes

P
protocols: Exported classes

R
remove-elements: Exported classes

S
Slot, add-attributes: Exported classes
Slot, allow-comments: Exported classes
Slot, attributes: Exported classes
Slot, elements: Exported classes
Slot, protocols: Exported classes
Slot, remove-elements: Exported classes
Slot, whitespace-elements: Exported classes
Special Variable, +basic+: Exported special variables
Special Variable, +default+: Exported special variables
Special Variable, +relaxed+: Exported special variables
Special Variable, +restricted+: Exported special variables

W
whitespace-elements: Exported classes

Jump to:   +  
A   E   P   R   S   W  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
Class, sanitize-mode: Exported classes

P
Package, sanitize: The sanitize package

S
sanitize: The sanitize system
sanitize: The sanitize package
sanitize-mode: Exported classes
System, sanitize: The sanitize system

Jump to:   C   P   S