Skip to content

Commit

Permalink
Merge pull request #317 from xvw/fix-some-typos
Browse files Browse the repository at this point in the history
Reintroduction of `formmethod`
  • Loading branch information
Drup committed Sep 27, 2023
2 parents becaf65 + 9679ba1 commit 3ffb4dc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/html_f.ml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ struct
let a_method x =
user_attrib C.string_of_big_variant "method" x

let a_formmethod = a_method
let a_formmethod x = user_attrib C.string_of_big_variant "formmethod" x

let a_enctype = string_attrib "enctype"

Expand Down
4 changes: 1 addition & 3 deletions lib/html_sigs.mli
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,7 @@ module type T = sig
[< | `Get | `Post] wrap -> [> | `Method] attrib

val a_formmethod :
[< | `Get | `Post] wrap -> [> | `Method] attrib
[@@ocaml.deprecated "Use a_method"]
(** @deprecated Use a_method *)
[< | `Get | `Post] wrap -> [> | `Formmethod] attrib

val a_multiple : unit -> [> | `Multiple] attrib

Expand Down
4 changes: 3 additions & 1 deletion lib/html_types.mli
Original file line number Diff line number Diff line change
Expand Up @@ -2074,8 +2074,9 @@ type input_attrib =
| `Checked
| `Disabled
| `Form
| `Formation
| `Formaction
| `Formenctype
| `Formmethod
| `Method
| `Formnovalidate
| `Formtarget
Expand Down Expand Up @@ -2138,6 +2139,7 @@ type button_attrib =
| `Form
| `Formaction
| `Formenctype
| `Formmethod
| `Method
| `Formnovalidate
| `Formtarget
Expand Down
4 changes: 4 additions & 0 deletions test/test_html.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ let html_elements = "html elements", tyxml_tests Html.[
div [a []],
"<div><a></a></div>" ;

"input",
input ~a:[a_formaction "post.html"; a_formmethod `Post] (),
"<input formaction=\"post.html\" formmethod=\"POST\"/>";

"a",
canvas [a []],
"<canvas><a></a></canvas>";
Expand Down

0 comments on commit 3ffb4dc

Please sign in to comment.