Interesting |
= |
/[&<]/ |
|
Regular expressions used for parsing:
|
Incomplete |
= |
Regexp.compile('&([a-zA-Z][a-zA-Z0-9]*|#[0-9]*)?|' +
'<([a-zA-Z][^<>]*|/([a-zA-Z][^<>]*)?|' +
'![^<>]*)?') |
Entityref |
= |
/&([a-zA-Z][-.a-zA-Z0-9]*)[^-.a-zA-Z0-9]/ |
Endbracket |
= |
/<|>|\/>/ |
|
Assaf: fixed to allow tag to close
itself (XHTML)
|
Attrfind |
= |
Regexp.compile('[\s,]*([a-zA-Z_][a-zA-Z_0-9.-]*)' +
'(\s*=\s*' +
"('[^']*'" +
'|"[^"]*"' +
'|[-~a-zA-Z0-9,.:+*%?!()_#=]*))?') |
|
Assaf: / is no longer part of allowed attribute value
|
Entitydefs |
= |
{'lt'=>'<', 'gt'=>'>', 'amp'=>'&', 'quot'=>'"', 'apos'=>'\''} |