Skip to content

Commit

Permalink
Add an option to specify indentation level when converting Xml.t (and
Browse files Browse the repository at this point in the history
Html.t) to a string.
  • Loading branch information
Armael committed Feb 10, 2013
1 parent 060129e commit 4711a8d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/html.mli
Expand Up @@ -16,7 +16,7 @@

type t = (('a Xml.frag as 'a) Xml.frag) list

val to_string : t -> string
val to_string : ?indent:int -> t -> string

val of_string :
?templates:( (string * t) list ) ->
Expand Down
4 changes: 2 additions & 2 deletions lib/xml.ml
Expand Up @@ -1216,9 +1216,9 @@ let rec output_t o = function
output_t o t
| [] -> ()
let to_string t =
let to_string ?indent t =
let buf = Buffer.create 1024 in
let o = make_output (`Buffer buf) in
let o = make_output ~indent:indent (`Buffer buf) in
output o (`Dtd (Some ""));
output_t o t;
Buffer.contents buf
Expand Down
2 changes: 1 addition & 1 deletion lib/xml.mli
Expand Up @@ -766,7 +766,7 @@ let out_w3c_bureaucrats dst bl =
out (`El_end)]}
*)

val to_string : t -> string
val to_string : ?indent:int -> t -> string
val of_string :
?entity:(string -> string option) ->
?templates:( (string * t) list ) ->
Expand Down

0 comments on commit 4711a8d

Please sign in to comment.