You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/HTMLKitUtilities/HTMLEncoding.swift
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@
10
10
/// ### Interpolation Promotion
11
11
/// Swift HTMLKit tries to [promote](https://github.com/RandomHashTags/swift-htmlkit/blob/94793984763308ef5275dd9f71ea0b5e83fea417/Sources/HTMLKitMacros/HTMLElement.swift#L423) known interpolation at compile time with an equivalent string literal for the best performance, regardless of encoding.
12
12
/// It is currently limited due to macro expansions being sandboxed and lexical contexts/AST not being available for macro arguments.
13
-
/// This means referencing content known at compile time in a html macro won't get promoted to its expected value.
13
+
/// This means referencing content in an html macro won't get promoted to its expected value.
14
14
/// [Read more about this limitation](https://forums.swift.org/t/swift-lexical-lookup-for-referenced-stuff-located-outside-scope-current-file/75776/6).
15
15
///
16
16
/// #### Promotion Example
@@ -26,7 +26,7 @@
26
26
/// ```swift
27
27
/// let string:StaticString = "Test"
28
28
/// let _:StaticString = #html(div(string)) // ❌ promotion cannot be applied; StaticString not allowed
29
-
/// let _:String = #html(div(string)) // ⚠️ promotion cannot be applied; compiled as "<div>\(string)</div>"
29
+
/// let _:String = #html(div(string)) // ⚠️ promotion cannot be applied; compiles to "<div>\(string)</div>"
context.diagnose(Diagnostic(node: first_expression, message:DiagnosticMsg(id:"spacesNotAllowedInAttributeDeclaration", message:"Spaces are not allowed in attribute declaration.")))
0 commit comments