forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Lib html
kud1ing edited this page May 17, 2013
·
15 revisions
A library/module for escaping/unescaping of special HTML characters.
- Proposed editor: your name
- Date proposed: date of proposal
- Link: link to email
- note
- note
- note
- Standard: standard - link to docs - ...
- Standard: standard - link to docs - ...
- Technique: technique - link to docs - ...
- Technique: technique - link to docs - ...
- Language: Go
- html
-
EscapeString()
escapes only the 5 characters: <, >, &, ' and " -
UnescapeString()
unescapes more characters
-
- Language: PHP
- htmlspecialchars()
- escapes only the 5 characters: <, >, &, ' and " - htmlspecialchars_decode ()
- decodes only the characters handled by htmlspecialchars()
- Pull request: link to bug
Question: where to get from the complete list of characters to escape and entities to produce?
-
escape_minimal()
only escapes the necessary 5 (?) characters which are necessary for security/forms/URLs -
escape_full()
escapes all characters- We probably should use a table-lookup (binary search), similar to the code in https://github.com/mozilla/rust/blob/incoming/src/libcore/unicode.rs