Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
add description
Commit Description:
add description
"""
General functions for HTML manipulation.
"""
_escape_map = { ord ( '&' ): '&' , ord ( '<' ): '<' , ord ( '>' ): '>' }
_escape_map_full = { ord ( '&' ): '&' , ord ( '<' ): '<' , ord ( '>' ): '>' ,
ord ( '"' ): '"' , ord ( ' \' ' ): ''' }
# NB: this is a candidate for a bytes/string polymorphic interface
def escape ( s , quote = True ):
"""
Replace special characters "&", "<" and ">" to HTML-safe sequences.
If the optional flag quote is true (the default), the quotation mark
characters, both double quote (") and single quote (') characters are also
translated.
"""
if quote :
return s . translate ( _escape_map_full )
return s . translate ( _escape_map )
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings