From 1ee2eca6cc0916ff396a973cb4d74f1e4aab8ef9 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Fri, 17 Nov 2023 06:19:55 -0800 Subject: [PATCH 1/2] Fix attributes go naming conventions --- attrs/attrs.go | 74 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/attrs/attrs.go b/attrs/attrs.go index 1af3bd0..06d8e1f 100644 --- a/attrs/attrs.go +++ b/attrs/attrs.go @@ -2,6 +2,7 @@ package attrs const ( // Universal Attributes + Alt = "alt" Class = "class" Contenteditable = "contenteditable" @@ -14,8 +15,11 @@ const ( Loading = "loading" // Link/Script Attributes - Async = "async" + + Async = "async" + // Deprecated: Use Crossorigin instead CrossOrigin = "crossorigin" + Crossorigin = "crossorigin" Defer = "defer" Href = "href" Integrity = "integrity" @@ -24,19 +28,27 @@ const ( Target = "target" // Meta Attributes + Charset = "charset" Content = "content" HTTPequiv = "http-equiv" // e.g., for refresh or setting content type // Image/Embed Attributes + Height = "height" Width = "width" - IsMap = "ismap" + // Deprecated: Use Ismap instead + IsMap = "ismap" + Ismap = "ismap" // Semantic Text Attributes + + // Deprecated: Use Datetime instead DateTime = "datetime" + Datetime = "datetime" // Form/Input Attributes + Accept = "accept" Action = "action" Autocapitalize = "autocapitalize" @@ -51,27 +63,33 @@ const ( Low = "low" High = "high" Max = "max" - MaxLength = "maxlength" - Method = "method" // e.g., "GET", "POST" - Min = "min" - Multiple = "multiple" - Name = "name" - NoValidate = "novalidate" - Optimum = "optimum" - Placeholder = "placeholder" - Readonly = "readonly" - Required = "required" - Rows = "rows" - Selected = "selected" - Size = "size" - Step = "step" - Type = "type" - Value = "value" + // Deprecated: Use Maxlength instead + MaxLength = "maxlength" + Maxlength = "maxlength" + Method = "method" // e.g., "GET", "POST" + Min = "min" + Multiple = "multiple" + Name = "name" + // Deprecated: Use Novalidate instead + NoValidate = "novalidate" + Novalidate = "novalidate" + Optimum = "optimum" + Placeholder = "placeholder" + Readonly = "readonly" + Required = "required" + Rows = "rows" + Selected = "selected" + Size = "size" + Step = "step" + Type = "type" + Value = "value" // Interactive Attributes + Open = "open" // Miscellaneous Attributes + DataPrefix = "data-" // Used for custom data attributes e.g., "data-custom" Download = "download" Draggable = "draggable" @@ -79,20 +97,29 @@ const ( Spellcheck = "spellcheck" // Table Attributes + RowSpan = "rowspan" ColSpan = "colspan" Scope = "scope" Headers = "headers" // IFrame Attributes - Allow = "allow" + + Allow = "allow" + // Deprecated: Use AllowFullscreen instead AllowFullScreen = "allowfullscreen" + AllowFullscreen = "allowfullscreen" CSP = "csp" - ReferrerPolicy = "referrerpolicy" - Sandbox = "sandbox" - SrcDoc = "srcdoc" + // Deprecated: Use Referrerpolicy instead + ReferrerPolicy = "referrerpolicy" + Referrerpolicy = "referrerpolicy" + Sandbox = "sandbox" + // Deprecated: Use Srcdoc instead + SrcDoc = "srcdoc" + Srcdoc = "srcdoc" // Audio/Video Attributes + Controls = "controls" Loop = "loop" Muted = "muted" @@ -100,14 +127,17 @@ const ( Autoplay = "autoplay" // Video-Specific Attributes + Poster = "poster" Playsinline = "playsinline" // Source Element-Specific Attributes + Media = "media" Sizes = "sizes" // ARIA Attributes + AriaActivedescendant = "aria-activedescendant" AriaAtomic = "aria-atomic" AriaAutocomplete = "aria-autocomplete" From 1c93e0b96c55c48b3a29b19818b0e242031dbac8 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Fri, 17 Nov 2023 06:27:11 -0800 Subject: [PATCH 2/2] Add Minlength --- attrs/attrs.go | 1 + 1 file changed, 1 insertion(+) diff --git a/attrs/attrs.go b/attrs/attrs.go index 06d8e1f..99d31ef 100644 --- a/attrs/attrs.go +++ b/attrs/attrs.go @@ -68,6 +68,7 @@ const ( Maxlength = "maxlength" Method = "method" // e.g., "GET", "POST" Min = "min" + Minlength = "minlength" Multiple = "multiple" Name = "name" // Deprecated: Use Novalidate instead