Skip to content
Browse files

added output of vertical-align for attachments in htmlString

  • Loading branch information...
1 parent b091443 commit caefc7aabb3e8a26a5740929df6dc052d5b67c50 @odrobnik odrobnik committed
Showing with 27 additions and 0 deletions.
  1. +27 −0 Core/Source/NSAttributedString+DTCoreText.m
View
27 Core/Source/NSAttributedString+DTCoreText.m
@@ -252,6 +252,33 @@ - (NSString *)htmlString
[styleString appendFormat:@"height:%.0fpx;", attachment.originalSize.height];
}
+ if (attachment.verticalAlignment != DTTextAttachmentVerticalAlignmentBaseline)
+ {
+ switch (attachment.verticalAlignment)
+ {
+ case DTTextAttachmentVerticalAlignmentBaseline:
+ {
+ [styleString appendString:@"vertical-align:baseline;"];
+ break;
+ }
+ case DTTextAttachmentVerticalAlignmentTop:
+ {
+ [styleString appendString:@"vertical-align:text-top;"];
+ break;
+ }
+ case DTTextAttachmentVerticalAlignmentCenter:
+ {
+ [styleString appendString:@"vertical-align:middle;"];
+ break;
+ }
+ case DTTextAttachmentVerticalAlignmentBottom:
+ {
+ [styleString appendString:@"vertical-align:text-bottom;"];
+ break;
+ }
+ }
+ }
+
if ([styleString length])
{
[retString appendFormat:@" style=\"%@\"", styleString];

0 comments on commit caefc7a

Please sign in to comment.
Something went wrong with that request. Please try again.