NSMutableAttributedString(HTML) Category Reference
| Declared in | NSMutableAttributedString+HTML.h |
Instance Methods
addHTMLAttribute:value:range:replaceExisting:
Adds the custom HTML attributes with the given value on the given range, optionally replacing occurences of an attribute with the same name.
- (void)addHTMLAttribute:(NSString *)name value:(id)value range:(NSRange)range replaceExisting:(BOOL)replaceExistingParameters
- name
The name of the custom HTML attribute
- value
The value to set for the custom attribute
- range
The range to add the custom attribute for
- replaceExisting
YESif ranges that have an attribute with the same name should be replaced. WithNOthe attribute is only added for ranges where there is no attribute with the given name
Declared In
NSMutableAttributedString+HTML.happendEndOfParagraph
Adds the paragraph terminator \n and makes sure that the previous font and paragraph styles extend to include it
- (void)appendEndOfParagraphDeclared In
NSMutableAttributedString+HTML.happendString:
Appends a string with the same attributes as this string to this string.
- (void)appendString:(NSString *)stringParameters
- string
The string to be appended to this string.
Discussion
If the last character of the receiver contains a placeholder for a DTTextAttachment it is removed from the appended string. Also fields (e.g. list prefixes) are not extended
Declared In
NSMutableAttributedString+HTML.happendString:withParagraphStyle:fontDescriptor:
Appends a string with a given paragraph style and font to this string.
- (void)appendString:(NSString *)string withParagraphStyle:(DTCoreTextParagraphStyle *)paragraphStyle fontDescriptor:(DTCoreTextFontDescriptor *)fontDescriptorParameters
- string
The string to be appended to this string.
- paragraphStyle
Paragraph style to be attributed to the appended string.
- fontDescriptor
Font descriptor to be attributed to the appended string.
Declared In
NSMutableAttributedString+HTML.hremoveHTMLAttribute:range:
Adds the custom HTML attributes with the given value from the given range.
- (void)removeHTMLAttribute:(NSString *)name range:(NSRange)rangeParameters
- name
The name of the custom HTML attribute
- range
The range to add the custom attribute for
Declared In
NSMutableAttributedString+HTML.h