diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/xml_lexer.mll | 10 | ||||
| -rw-r--r-- | lib/xml_printer.ml | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/xml_lexer.mll b/lib/xml_lexer.mll index a33be9da73..f6943dd132 100644 --- a/lib/xml_lexer.mll +++ b/lib/xml_lexer.mll @@ -281,6 +281,11 @@ and dq_string = parse Buffer.add_char tmp (lexeme_char lexbuf 1); dq_string lexbuf } + | '&' + { + Buffer.add_string tmp (entity lexbuf); + dq_string lexbuf + } | eof { raise (Error EUnterminatedString) } | _ @@ -297,6 +302,11 @@ and q_string = parse Buffer.add_char tmp (lexeme_char lexbuf 1); q_string lexbuf } + | '&' + { + Buffer.add_string tmp (entity lexbuf); + q_string lexbuf + } | eof { raise (Error EUnterminatedString) } | _ diff --git a/lib/xml_printer.ml b/lib/xml_printer.ml index eeddd53cb8..bbb7b51ba3 100644 --- a/lib/xml_printer.ml +++ b/lib/xml_printer.ml @@ -46,6 +46,8 @@ let buffer_attr tmp (n,v) = match v.[p] with | '\\' -> output "\\\\" | '"' -> output "\\\"" + | '<' -> output "<" + | '&' -> output "&" | c -> output' c done; output' '"' |
