genhtml-js
v0.1.0
Published
pure Javascript HTML generation and templating
Downloads
11
Readme
genhtml-js
Description
- Model
- nodes
- name:
/^[a-zA-z]+$/
- attributes
- unique names
- children: any number of nodes, comments, texts
- name:
- text
- value:
/^([^&<>"']|&(lt|gt|amp|quot|apos);)*$/
- value:
- attributes
- name:
/^[a-zA-z]+$/
- value:
/^"([^&<>"']|&(lt|gt|amp|quot|apos);)*"$/
escaping single-quote delimiting? question: what about empty or missing values?
- name:
- comments
- root
- doctype: ?? any number of attribute names or strings?
- children: any number of nodes, comments, texts
- nodes
- Serialization
- significant whitespace
- self-closing tags vs. open/close pairs
A laundry list of aspects (some may not be implemented)
model
- elements
- attributes
- comments
- root node
- text nodes
- schema: child nodes, attributes allowed
- directives
<!doctype html>
- processing instructions
- cdata
- document type declaration
serialization
- escaping: structure of document must not be changeable through
serialization loopholes
<
-><
- amp, gt, apos (same as #x27 -- hex ??), quot
- what is "replacement text" and what does it have to do with double escaping?
- empty elements --
<input />
versus open/close pairs:<a></a>
- ?? sanitizing ??
- escaping: structure of document must not be changeable through
serialization loopholes
syntax restrictions
- elements
- names: spec for both element & attribute names
- wikipedia: tag names can't include any of
-.0123456789!"#$%&'()*+,/;<=>?@[\]^
{|}~`, or spaces
- attributes
- names
- unique names within an element
- comments
- no escaping (according to wikipedia)
- can't have
--
inside a comment
- elements
(in)significant whitespace
pre
vsp