Skip to content

Commit

Permalink
Merge pull request #84 from chasefleming/chasefleming/83
Browse files Browse the repository at this point in the history
Fix Incorrectly Cased Attributes
  • Loading branch information
chasefleming authored Nov 17, 2023
2 parents d20f39d + 1c93e0b commit c657e09
Showing 1 changed file with 53 additions and 22 deletions.
75 changes: 53 additions & 22 deletions attrs/attrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package attrs

const (
// Universal Attributes

Alt = "alt"
Class = "class"
Contenteditable = "contenteditable"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -51,63 +63,82 @@ 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"
Minlength = "minlength"
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"
Role = "role" // Used for ARIA roles
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"
Preload = "preload"
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"
Expand Down

0 comments on commit c657e09

Please sign in to comment.