Skip to content

Commit

Permalink
escape strings
Browse files Browse the repository at this point in the history
Signed-off-by: George Lemon <[email protected]>
  • Loading branch information
georgelemon committed Apr 19, 2024
1 parent 576943d commit 17bb13f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/nyml/parser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import toktok
import std/[json, jsonutils]
import std/strutils except NewLines
from std/xmltree import escape
import ./meta

handlers:
Expand Down Expand Up @@ -51,7 +52,7 @@ handlers:
proc handleUnknown*(lex: var Lexer) =
lex.startPos = lex.getColNumber(lex.bufpos)
case lex.buf[lex.bufpos]:
of '$', '/', '^', '(', ')':
of '$', '/', '^', '(', ')', '<': # todo something to handle all chars except stoppers
lex.handleCustomIdent()
else:
add lex.token, lex.buf[lex.bufpos]
Expand Down Expand Up @@ -276,7 +277,7 @@ proc writeNodes(p: var Parser, node: seq[Node]) =
of Int:
$= node[i].intv
of String:
$= node[i].strv
$= xmltree.escape(node[i].strv)
of Nil:
p.code &= "null"
of Variable:
Expand Down

0 comments on commit 17bb13f

Please sign in to comment.