Merge branch 'master' of github.com:Araq/Nimrod
This commit is contained in:
commit
4fd42d5150
43 changed files with 262 additions and 177 deletions
|
|
@ -649,7 +649,8 @@ proc nl(s: var string, ml: bool) =
|
|||
|
||||
proc escapeJson*(s: string): string =
|
||||
## Converts a string `s` to its JSON representation.
|
||||
result = "\""
|
||||
result = newStringOfCap(s.len + s.len shr 3)
|
||||
result.add("\"")
|
||||
for x in runes(s):
|
||||
var r = int(x)
|
||||
if r >= 32 and r <= 127:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue