The html-entities Reference Manual

Table of Contents

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

The html-entities Reference Manual

This is the html-entities Reference Manual, version 0.2, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:00:53 2018 GMT+0.


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

1 Introduction

About html-entities

Html-entities lets you encode and decode entities in HTML.

Encoding

(html-entities:encode-entities "This string contains <>&") => "This string contains &lt;&gt;&amp;"

By default, it will encode all strange characters. For example,

(html-entities:encode-entities "ø ¬ Û") => "&oslash; &not; &Ucirc;"

You can make it a different set of characters by providing the encode-entities function with a regex. Only matching characters will be encoded:

;; only encode <, >, and &
(html-entities:encode-entities "ø ¬ Û <> &" :regex "[<>&]") => "ø ¬ Û &lt;&gt; &amp;"

You can also control the behavior with the variables *encode-using-named-entities* and *encode-in-hexadecimal*.

Decoding

(html-entities:decode-entities "&oslash; &not; &Ucirc;") => "ø ¬ Û"

The decode-entities function has no special options, it simply decodes everything it comes across.

SGML mode

The special variable *enable-sgml* (nil by default) makes the encoding functions use the SGML mappings for encoding and decoding rather than the HTML ones. SGML entities are almost a perfect superset of HTML entities, with the exception of ', which maps to U+0027 (the normal single-quote character) in HTML but U+02BC (MODIFIER_LETTER_APOSTROPHE) in SGML. You probably don't need this, unless you get errors when decoding someone else's text because the SGML entities aren't recognized.

Other Notes

This library requires cl-ppcre. It has only been tested with SBCL, but it doesn't have anything crazy that should cause trouble with other Common Lisp implementations. Unicode might be a problem, I'm not sure how that's handled in other lisps.

Html-entities was originally written by Aaron Sokoloski (asokoloski@gmail.com). The old repository is [here](https://code.google.com/archive/p/html


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 html-entities

Author

Aaron Sokoloski <asokoloski@gmail.com>

License

MIT License

Description

A module for encoding and decoding HTML/XML/SGML entities.

Version

0.2

Dependency

cl-ppcre

Source

html-entities.asd (file)

Components

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

3 Files

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


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

3.1 Lisp


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

3.1.1 html-entities.asd

Location

html-entities.asd

Systems

html-entities (system)

Packages

html-entities-asd


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

3.1.2 html-entities/packages.lisp

Parent

html-entities (system)

Location

packages.lisp

Packages

html-entities


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

3.1.3 html-entities/entity-tables.lisp

Dependency

packages.lisp (file)

Parent

html-entities (system)

Location

entity-tables.lisp

Internal Definitions

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

3.1.4 html-entities/html-entities.lisp

Dependencies
Parent

html-entities (system)

Location

html-entities.lisp

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 html-entities-asd

Source

html-entities.asd

Use List

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

4.2 html-entities

Main package for html-entities.

Source

packages.lisp (file)

Use List
Exported Definitions
Internal Definitions

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

5 Definitions

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


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

5.1 Exported definitions


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

5.1.1 Special variables

Special Variable: *enable-sgml*

Encode and decode using SGML entity names, of which HTML entity names are almost a subset (&apos; is different).

Package

html-entities

Source

html-entities.lisp (file)

Special Variable: *encode-in-hexadecimal*

When a symbolic name is not available, use hexadecimal-based integers: &#xE1; instead of &#225; .

Package

html-entities

Source

html-entities.lisp (file)

Special Variable: *encode-using-named-entities*

Use symbolic names, such as &aacute; , rather than &#225; or &#xE1; .

Package

html-entities

Source

html-entities.lisp (file)


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

5.1.2 Functions

Function: char-of-name NAME
Package

html-entities

Source

html-entities.lisp (file)

Function: char-to-entity CHAR-OR-STRING
Package

html-entities

Source

html-entities.lisp (file)

Function: decode-entities HTML

Decodes all entites in HTML.

Package

html-entities

Source

html-entities.lisp (file)

Function: encode-entities HTML &key REGEX

Encodes entites in HTML. Defaults to pretty much everything you can, but you can pass a regex like "[<>&\"]" to only encode the basics.

Package

html-entities

Source

html-entities.lisp (file)

Function: entity-to-char STRING
Package

html-entities

Source

html-entities.lisp (file)

Function: name-of-char CHAR
Package

html-entities

Source

html-entities.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Special variables

Special Variable: *char-to-name*
Package

html-entities

Source

html-entities.lisp (file)

Special Variable: *entity-definitions*
Package

html-entities

Source

entity-tables.lisp (file)

Special Variable: *escape-all*
Package

html-entities

Source

html-entities.lisp (file)

Special Variable: *name-to-char*
Package

html-entities

Source

html-entities.lisp (file)

Special Variable: *sgml-char-to-name*
Package

html-entities

Source

html-entities.lisp (file)

Special Variable: *sgml-entity-definitions*
Package

html-entities

Source

entity-tables.lisp (file)

Special Variable: *sgml-name-to-char*
Package

html-entities

Source

html-entities.lisp (file)


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

5.2.2 Functions

Function: init-hashes ()
Package

html-entities

Source

html-entities.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   H   L  
Index Entry  Section

F
File, Lisp, html-entities.asd: The html-entities<dot>asd file
File, Lisp, html-entities/entity-tables.lisp: The html-entities/entity-tables<dot>lisp file
File, Lisp, html-entities/html-entities.lisp: The html-entities/html-entities<dot>lisp file
File, Lisp, html-entities/packages.lisp: The html-entities/packages<dot>lisp file

H
html-entities.asd: The html-entities<dot>asd file
html-entities/entity-tables.lisp: The html-entities/entity-tables<dot>lisp file
html-entities/html-entities.lisp: The html-entities/html-entities<dot>lisp file
html-entities/packages.lisp: The html-entities/packages<dot>lisp file

L
Lisp File, html-entities.asd: The html-entities<dot>asd file
Lisp File, html-entities/entity-tables.lisp: The html-entities/entity-tables<dot>lisp file
Lisp File, html-entities/html-entities.lisp: The html-entities/html-entities<dot>lisp file
Lisp File, html-entities/packages.lisp: The html-entities/packages<dot>lisp file

Jump to:   F   H   L  

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

A.2 Functions

Jump to:   C   D   E   F   I   N  
Index Entry  Section

C
char-of-name: Exported functions
char-to-entity: Exported functions

D
decode-entities: Exported functions

E
encode-entities: Exported functions
entity-to-char: Exported functions

F
Function, char-of-name: Exported functions
Function, char-to-entity: Exported functions
Function, decode-entities: Exported functions
Function, encode-entities: Exported functions
Function, entity-to-char: Exported functions
Function, init-hashes: Internal functions
Function, name-of-char: Exported functions

I
init-hashes: Internal functions

N
name-of-char: Exported functions

Jump to:   C   D   E   F   I   N  

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

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*char-to-name*: Internal special variables
*enable-sgml*: Exported special variables
*encode-in-hexadecimal*: Exported special variables
*encode-using-named-entities*: Exported special variables
*entity-definitions*: Internal special variables
*escape-all*: Internal special variables
*name-to-char*: Internal special variables
*sgml-char-to-name*: Internal special variables
*sgml-entity-definitions*: Internal special variables
*sgml-name-to-char*: Internal special variables

S
Special Variable, *char-to-name*: Internal special variables
Special Variable, *enable-sgml*: Exported special variables
Special Variable, *encode-in-hexadecimal*: Exported special variables
Special Variable, *encode-using-named-entities*: Exported special variables
Special Variable, *entity-definitions*: Internal special variables
Special Variable, *escape-all*: Internal special variables
Special Variable, *name-to-char*: Internal special variables
Special Variable, *sgml-char-to-name*: Internal special variables
Special Variable, *sgml-entity-definitions*: Internal special variables
Special Variable, *sgml-name-to-char*: Internal special variables

Jump to:   *  
S  

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

A.4 Data types

Jump to:   H   P   S  
Index Entry  Section

H
html-entities: The html-entities system
html-entities: The html-entities package
html-entities-asd: The html-entities-asd package

P
Package, html-entities: The html-entities package
Package, html-entities-asd: The html-entities-asd package

S
System, html-entities: The html-entities system

Jump to:   H   P   S