@@ -147,26 +147,40 @@ extension ASAttributedString.Attribute {
147147 }
148148}
149149
150- extension AttributedStringInterpolation {
150+ extension ASAttributedStringInterpolation {
151151
152152 public typealias Attribute = ASAttributedString . Attribute
153153 public typealias WrapMode = ASAttributedString . WrapMode
154154
155155 public mutating func appendInterpolation< T> ( _ value: T , _ attributes: Attribute ... ) {
156156 appendInterpolation ( value, with: attributes)
157157 }
158-
159158 public mutating func appendInterpolation< T> ( _ value: T , with attributes: [ Attribute ] ) {
160159 self . value. append ( ASAttributedString ( " \( value) " , with: attributes) . value)
161160 }
162161
162+ public mutating func appendInterpolation( _ value: NSAttributedString , _ attributes: Attribute ... ) {
163+ appendInterpolation ( value, with: attributes)
164+ }
165+ public mutating func appendInterpolation( _ value: NSAttributedString , with attributes: [ Attribute ] ) {
166+ self . value. append ( ASAttributedString ( value, with: attributes) . value)
167+ }
168+
169+ public mutating func appendInterpolation( _ value: ASAttributedString , _ attributes: Attribute ... ) {
170+ appendInterpolation ( value, with: attributes)
171+ }
172+ public mutating func appendInterpolation( _ value: ASAttributedString , with attributes: [ Attribute ] ) {
173+ self . value. append ( ASAttributedString ( value, with: attributes) . value)
174+ }
175+
163176 // 嵌套包装
164177 public mutating func appendInterpolation( wrap string: ASAttributedString , _ attributes: Attribute ... ) {
165178 appendInterpolation ( wrap: string, with: attributes)
166179 }
167180 public mutating func appendInterpolation( wrap string: ASAttributedString , with attributes: [ Attribute ] ) {
168- self . value. append ( ASAttributedString ( wrap : . embedding ( string) , with: attributes) . value)
181+ self . value. append ( ASAttributedString ( string, with: attributes) . value)
169182 }
183+
170184 public mutating func appendInterpolation( wrap mode: WrapMode , _ attributes: Attribute ... ) {
171185 appendInterpolation ( wrap: mode, with: attributes)
172186 }
0 commit comments