Skip to content

Commit 63a3c6d

Browse files
committed
Antiquotations are not whitespace.
1 parent 5e6501d commit 63a3c6d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ppx/ppx_element_content.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ let is_whitespace = function
4949
| Some s when String.trim s = "" -> true
5050
| _ -> false
5151
end
52-
| _ -> true
52+
| _ -> false
5353

5454
(* Given a list of parse trees representing children of an element, filters out
5555
all children that consist of applications of [pcdata] to strings containing

test/test_ppx.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ let antiquot = "ppx antiquot", tyxml_tests Html.[
173173
[[%html "<p id="id">bla</p>"]],
174174
[p ~a:[a_id id] [pcdata "bla"]];
175175

176+
"first child",
177+
[%html [elt1] "<p></p>"],
178+
[elt1 ; p []];
179+
180+
"last child",
181+
[%html "<p></p>" [elt1] ],
182+
[p []; elt1];
183+
176184
(* should succeed *)
177185
(* "escape", *)
178186
(* [%tyxml "<p>(tyxml4)</p>"], *)

0 commit comments

Comments
 (0)