fi3ework / hexo-theme-archer

🎯 A smart and modern theme for Hexo.
https://fi3ework.github.io/hexo-theme-archer
MIT License
1.53k stars 275 forks source link

代码块显示问题 #64

Closed sunshineLixun closed 6 years ago

sunshineLixun commented 6 years ago

image

您好,很喜欢这套主题,但是我似乎碰到了一些问题。 这个是我关于上述图片对应的MD语法

- (CGFloat)cellHeight{
    CGFloat publicHeight = kViewTopPadding + kImageSize().height + kViewTypeMargin + _nameStrSize.height + kViewTypePadding + _nameTextSize.height + kViewTypeMargin / 2 + kCellBottomPadding;
    switch (_layoutViewType) {
        case ViewLayoutBreviaryType:
            return publicHeight;
            break;
        case ViewLayoutDetailType:
            //判断当前model存储的信息是待执行还是已取消状态
            if (_orderModel.reserveType == YWBOrderReservationToBeConfirm) {
                return publicHeight + kViewTypeMargin / 2 + _addressStrSize.height + kViewTypePadding + _addressTextSize.height + kViewTypeMargin + _typeStrSize.height + _typeTextSize.height + kViewTypeMargin + kButtonHeight + kViewBottomPadding + kCellBottomPadding;
            }else if(_orderModel.reserveType == YWBOrderReservationCancledForSaler || _orderModel.reserveType == YWBOrderReservationCancledForClient){
                return publicHeight + kViewTypeMargin / 2 + _addressStrSize.height + kViewTypePadding + _addressTextSize.height + kViewTypeMargin + _cancleStrSize.height + kViewTypePadding + _cancleTextSize.height + kViewBottomPadding + kCellBottomPadding;
            }
           break;
    }
    return 0.0;
}

- (CGFloat)heightWithWidth:(CGFloat)width font:(UIFont *)font
{
    CGRect attrsRect = [self boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX)
                                          options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading
                                       attributes:@{NSFontAttributeName : font}
                                          context:nil];
    return attrsRect.size.height;
}

但是别的文章这么写的MD语法,就不会存在这个问题
sunshineLixun commented 6 years ago

在next主题中,该代码块显示无误

fi3ework commented 6 years ago

@sunshineLixun 我在windows和mac上都看不到你显示的错误呢,初步猜测是因为你使用的是tab的原因,能具体介绍一下是在什么环境什么浏览器下吗

sunshineLixun commented 6 years ago

@fi3ework 我修改看下