forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Lib html
kud1ing edited this page Aug 4, 2013
·
16 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< > & ' "
-
UnescapeString()
unescapes more characters
-
- Language: PHP
- htmlspecialchars()
- escapes only the 5 characters
< > & ' "
- htmlspecialchars_decode () - decodes only the characters handled by htmlspecialchars()
- escapes only the 5 characters
See https://github.com/veddan/rust-htmlescape
- 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