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

fixed typo seperated/separated #59

Merged
merged 1 commit into from
Dec 6, 2024
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: 4 additions & 0 deletions Sources/Elementary/Core/Html+Attributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ public struct HTMLAttributeMergeAction: Sendable {
public static var ignoring: Self { .init(mergeMode: .ignoreIfSet) }

/// Appends the new value to the existing value, separated by the specified string.
@available(*, deprecated, renamed: "appending(separatedBy:)")
public static func appending(seperatedBy: String) -> Self { .init(mergeMode: .appendValue(seperatedBy)) }

/// Appends the new value to the existing value, separated by the specified string.
public static func appending(separatedBy: String) -> Self { .init(mergeMode: .appendValue(separatedBy)) }
}

public extension HTMLAttribute {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Elementary/HtmlAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ public extension HTMLAttribute where Tag: HTMLTrait.Attributes.Global {
}

static func `class`(_ value: String) -> Self {
HTMLAttribute(name: "class", value: value, mergedBy: .appending(seperatedBy: " "))
HTMLAttribute(name: "class", value: value, mergedBy: .appending(separatedBy: " "))
}

static func data(_ key: String, value: String) -> Self {
HTMLAttribute(name: "data-\(key)", value: value)
}

static func style(_ value: String) -> Self {
HTMLAttribute(name: "style", value: value, mergedBy: .appending(seperatedBy: ";"))
HTMLAttribute(name: "style", value: value, mergedBy: .appending(separatedBy: ";"))
}

static func title(_ value: String) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions Tests/ElementaryTests/AttributeRenderingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ final class AttributeRenderingTests: XCTestCase {
func testRespectsCustomMergeMode() async throws {
try await HTMLAssertEqual(
br(.id("1"), .data("bar", value: "baz"))
.attributes(.id("2").mergedBy(.appending(seperatedBy: "-")))
.attributes(.id("2").mergedBy(.appending(separatedBy: "-")))
.attributes(.id("3").mergedBy(.ignoring))
.attributes(.data("bar", value: "baq").mergedBy(.appending(seperatedBy: ""))),
.attributes(.data("bar", value: "baq").mergedBy(.appending(separatedBy: ""))),
#"<br id="1-2" data-bar="bazbaq">"#
)
}
Expand Down
Loading