mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-04-05 07:16:17 +00:00
Fix bug with text for nodes. Add escaping symbols.
This commit is contained in:
18
script/utils.js
Normal file
18
script/utils.js
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
function gEncodeToHTML(str)
|
||||
{
|
||||
return str.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
|
||||
function gDecodeFromHTML(str)
|
||||
{
|
||||
return str.replace(/'/g, "'")
|
||||
.replace(/"/g, '"')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/</g, '<')
|
||||
.replace(/&/g, '&');
|
||||
}
|
||||
Reference in New Issue
Block a user