diff --git a/ppx/ppx_tyxml.ml b/ppx/ppx_tyxml.ml index e7d27debe..afc6abad6 100644 --- a/ppx/ppx_tyxml.ml +++ b/ppx/ppx_tyxml.ml @@ -278,7 +278,7 @@ let context_of_lang = function (** Given the payload of a [%html ...] or [%svg ...] expression, converts it to a TyXML expression representing the markup contained therein. *) -let markup_to_expr lang loc expr = +let markup_to_expr ?(simplify=true) lang loc expr = let context = context_of_lang lang in let input_stream, adjust_location = ast_to_stream expr in @@ -331,7 +331,7 @@ let markup_to_expr lang loc expr = in match l with - | [ Val x | Antiquot x ] -> x + | [ Val x | Antiquot x ] when simplify -> x | l -> Ppx_common.list_wrap_value lang loc l let markup_to_expr_with_implementation lang modname loc expr = diff --git a/ppx/ppx_tyxml.mli b/ppx/ppx_tyxml.mli index dced44352..343f71f84 100644 --- a/ppx/ppx_tyxml.mli +++ b/ppx/ppx_tyxml.mli @@ -25,6 +25,7 @@ *) val markup_to_expr : + ?simplify:bool -> Ppx_common.lang -> Location.t -> Parsetree.expression list -> Parsetree.expression (** Given the payload of a [%html ...] or [%svg ...] expression,