Skip to content
This repository
file 52 lines (40 sloc) 1.247 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
//
// GBCommentComponent.m
// appledoc
//
// Created by Tomaz Kragelj on 14.2.11.
// Copyright 2011 Gentle Bytes. All rights reserved.
//

#import "GBApplicationSettingsProvider.h"
#import "GBCommentComponent.h"

@implementation GBCommentComponent

#pragma mark Initialization & disposal

+ (id)componentWithStringValue:(NSString *)value {
return [self componentWithStringValue:value sourceInfo:nil];
}

+ (id)componentWithStringValue:(NSString *)value sourceInfo:(GBSourceInfo *)info {
GBCommentComponent *result = [[[self alloc] init] autorelease];
result.stringValue = value;
result.sourceInfo = info;
return result;
}

#pragma mark Derived values

- (NSString *)htmlValue {
if (!self.settings) return self.markdownValue;
if (_htmlValue) return _htmlValue;
_htmlValue = [self.settings stringByConvertingMarkdownToHTML:self.markdownValue];
return _htmlValue;
}

- (NSString *)textValue {
if (!self.settings) return self.markdownValue;
if (_textValue) return _textValue;
_textValue = [self.settings stringByConvertingMarkdownToText:self.markdownValue];
return _textValue;
}

#pragma mark Properties

@synthesize relatedItem;
@synthesize stringValue;
@synthesize markdownValue;
@synthesize sourceInfo;
@synthesize settings;

@end
Something went wrong with that request. Please try again.