Skip to content

Commit ae50a2d

Browse files
committed
Fix break change
1 parent 8faf99f commit ae50a2d

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

Sources/Elementary/Core/HtmlBuilder+Tuples.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public extension HTMLBuilder {
4444
// variadic generics currently not supported in embedded
4545
#if !hasFeature(Embedded)
4646
@inlinable
47+
@available(iOS 17, *)
4748
static func buildBlock<each Content>(_ content: repeat each Content) -> _HTMLTuple<repeat each Content>
4849
where repeat each Content: HTML {
4950
_HTMLTuple(repeat each content)
@@ -273,8 +274,10 @@ public struct _HTMLTuple6<V0: HTML, V1: HTML, V2: HTML, V3: HTML, V4: HTML, V5:
273274

274275
// variadic generics currently not supported in embedded
275276
#if !hasFeature(Embedded)
277+
@available(iOS 17, *)
276278
extension _HTMLTuple: Sendable where repeat each Child: Sendable {}
277279

280+
@available(iOS 17, *)
278281
public struct _HTMLTuple<each Child: HTML>: HTML {
279282
public let value: (repeat each Child)
280283

Sources/Elementary/Rendering/HtmlTextRenderer.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if os(iOS)
2+
import Foundation
3+
#endif
4+
15
#if !hasFeature(Embedded)
26
struct HTMLTextRenderer: _HTMLRendering {
37
private var result: [UInt8] = []
@@ -25,6 +29,7 @@ struct HTMLStreamRenderer: _HTMLRendering {
2529
}
2630
}
2731

32+
2833
struct PrettyHTMLTextRenderer {
2934
let indentation: String
3035

@@ -68,7 +73,11 @@ struct PrettyHTMLTextRenderer {
6873
}
6974

7075
if currentInlineText.contains("\n") {
76+
#if os(iOS)
77+
currentInlineText = currentInlineText.replacingOccurrences(of: "\n", with: "\n\(currentIndentation)")
78+
#else
7179
currentInlineText.replace("\n", with: "\n\(currentIndentation)")
80+
#endif
7281
addLineBreak()
7382
result += currentInlineText
7483
return true

Sources/Elementary/ServerSupport/SendOnceBox.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#if compiler(>=6.0) && !hasFeature(Embedded) && !os(iOS)
1+
#if compiler(>=6.0) && !hasFeature(Embedded)
22
import Synchronization
33

4-
@available(macOS 15.0, *)
4+
@available(iOS 18, macOS 15, *)
55
final class SendOnceBox: Sendable, SendOnceBoxing {
66
// final class SendOnceBox<Value>: Sendable, SendOnceBoxing {
77
typealias Value = any HTML

Sources/Elementary/ServerSupport/SendableAnyHTMLBox.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
#if !hasFeature(Embedded) && !os(iOS)
1+
#if !hasFeature(Embedded)
22
/// A wrapper around an `any HTML` value that can be safely sent once.
33
///
44
/// Note: For non-sendable values, this will only allow the value to be taken only once.
55
/// Sendable values can safely be taken multiple times.
6+
7+
@available(iOS 18, *)
68
public struct _SendableAnyHTMLBox: Sendable {
79
var storage: Storage
810

0 commit comments

Comments
 (0)