Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the type modifier of the orderedlist element accept the marker enum #169

Merged
merged 1 commit into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/HTMLKit/Abstraction/Elements/BodyElements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5551,8 +5551,8 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib
return mutate(start: size)
}

public func type(_ value: String) -> OrderedList {
return mutate(type: value)
public func type(_ value: Values.Marker) -> OrderedList {
return mutate(type: value.rawValue)
}

public func popover(_ value: Values.Popover.State) -> OrderedList {
Expand Down
17 changes: 14 additions & 3 deletions Sources/HTMLKit/Abstraction/Tokens/ValueTokens.swift
Original file line number Diff line number Diff line change
Expand Up @@ -437,17 +437,28 @@ public enum Values {
case xIcon = "image/x-icon"
}

/// The type is for
/// A enumeration of potential list markers
///
/// ```html
/// <ol type="I"></ol>
/// ```swift
/// OrderedList {
/// }
/// .type(.lowercaseAlpha)
/// ```
public enum Marker: String {

/// Uses numbers e.g. 1, 2, 3
case decimal = "1"

/// Uses uppercase letters e.g. A, B, C
case uppercaseAlpha = "A"

/// Uses lowercase letters e.g. a, b, c
case lowercaseAlpha = "a"

/// Uses uppercase Roman numerals e.g. I, II, III
case uppercaseRoman = "I"

/// Uses lowercase Roman numerals e.g. i, ii, iii
case lowercaseRoman = "i"
}

Expand Down