@@ -252,6 +252,22 @@ - (void)_setParagraphStyleOnAttributedString:(NSMutableAttributedString *)attrib
252252 value: paragraphStyle
253253 range: (NSRange ){0 , attributedString.length }];
254254 }
255+
256+
257+ // underline and line-through
258+ _textDecorationStyle = _textDecorationStyle ? : NSUnderlineStyleSingle;
259+ if (_textDecorationLine == RCTTextDecorationTypeUnderline || _textDecorationLine == RCTTextDecorationTypeUnderlineStrikethrough) {
260+ [self _addAttribute: NSUnderlineStyleAttributeName withValue: [NSNumber numberWithInt: _textDecorationStyle] toAttributedString: attributedString];
261+ }
262+ if (_textDecorationLine == RCTTextDecorationTypeStrikethrough || _textDecorationLine == RCTTextDecorationTypeUnderlineStrikethrough){
263+ [self _addAttribute: NSStrikethroughStyleAttributeName withValue: [NSNumber numberWithInt: _textDecorationStyle] toAttributedString: attributedString];
264+ }
265+
266+ if (_textDecorationColor) {
267+ [self _addAttribute: NSStrikethroughColorAttributeName withValue: _textDecorationColor toAttributedString: attributedString];
268+ [self _addAttribute: NSUnderlineColorAttributeName withValue: _textDecorationColor toAttributedString: attributedString];
269+ }
270+
255271}
256272
257273- (void )fillCSSNode : (css_node_t *)node
@@ -298,5 +314,8 @@ - (void)set##setProp:(type)value; \
298314RCT_TEXT_PROPERTY(ShadowOffset, _shadowOffset, CGSize)
299315RCT_TEXT_PROPERTY(TextAlign, _textAlign, NSTextAlignment )
300316RCT_TEXT_PROPERTY(WritingDirection, _writingDirection, NSWritingDirection )
317+ RCT_TEXT_PROPERTY(TextDecorationStyle, _textDecorationStyle, NSUnderlineStyle );
318+ RCT_TEXT_PROPERTY (TextDecorationColor, _textDecorationColor, UIColor *);
319+ RCT_TEXT_PROPERTY (TextDecorationLine, _textDecorationLine, RCTTextDecorationType);
301320
302321@end
0 commit comments