Skip to content

Commit

Permalink
Add ppx support for type instead source.
Browse files Browse the repository at this point in the history
Fix #229.
  • Loading branch information
Drup committed Jan 24, 2020
1 parent 244381e commit 731ea42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/html_sigs.mli
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ module type T = sig
should ignore leading zeros. *)

val a_mime_type : contenttype wrap -> [> | `Mime_type] attrib
[@@reflect.attribute "type" ["object"; "embed"; "area"; "link"]]
[@@reflect.attribute "type" ["object"; "embed"; "area"; "link"; "source"]]
(** This attribute gives an advisory hint as to the content type
of the content available at the link target address. It
allows user agents to opt to use a fallback mechanism rather
Expand Down
4 changes: 4 additions & 0 deletions test/test_ppx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ let basics = "ppx basics", HtmlTests.make Html.[
[figure ~figcaption:(`Bottom (figcaption [txt " hello "]))
[txt " "; img ~src:"foo.jpg" ~alt:"a" () ; txt " " ]];

"type in source",
[[%html {|<source src="foo.mp3" type="audio/mpeg"/>|}]],
[source ~a:[a_src "foo.mp3"; a_mime_type "audio/mpeg"] ()]

]

let attribs = "ppx attribs", HtmlTests.make Html.[
Expand Down

0 comments on commit 731ea42

Please sign in to comment.