Skip to content

Commit 77f9ca2

Browse files
committed
Add Microdata test
1 parent 83ff0d5 commit 77f9ca2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/test_ppx.ml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,27 @@ let attribs = "ppx attribs", HtmlTests.make Html.[
303303
[[%html "<div aria-hidden=true></div>"]],
304304
[div ~a:[a_aria "hidden" ["true"]] []] ;
305305

306+
"microdata attributes",
307+
308+
[[%html "<dl itemscope itemtype='https://md.example.com/track https://md.example.com/lighting'><dt>Name</dt><dd itemprop='name'>Turnout Lantern Kit</dd><dt>Purpose<dd>For retrofitting 2 <span itemprop='track-type'>C</span> Track turnouts.<meta itemprop='scale' content='HO'></dl>"]],
309+
[dl
310+
~a: [
311+
a_itemscope ();
312+
a_itemtype ["https://md.example.com/track"; "https://md.example.com/lighting"];
313+
]
314+
[
315+
dt [txt "Name"];
316+
dd ~a: [a_itemprop "name"] [txt "Turnout Lantern Kit"];
317+
dt [txt "Purpose"];
318+
dd
319+
[
320+
txt "For retrofitting 2 ";
321+
span ~a: [a_itemprop "track-type"] [txt "C"];
322+
txt " Track turnouts.";
323+
meta_itemprop "scale" ~a: [a_content "HO"] ();
324+
]
325+
]];
326+
306327
"touch events",
307328
[[%html "<div ontouchstart='alert()'></div>"]],
308329
[div ~a:[a_ontouchstart "alert()"] []] ;

0 commit comments

Comments
 (0)