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)replaceExisting
Parameters
- 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
YES
if ranges that have an attribute with the same name should be replaced. WithNO
the attribute is only added for ranges where there is no attribute with the given name
Declared In
NSMutableAttributedString+HTML.h
appendEndOfParagraph
Adds the paragraph terminator \n
and makes sure that the previous font and paragraph styles extend to include it
- (void)appendEndOfParagraph
Declared In
NSMutableAttributedString+HTML.h
appendString:
Appends a string with the same attributes as this string to this string.
- (void)appendString:(NSString *)string
Parameters
- 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.h
appendString:withParagraphStyle:fontDescriptor:
Appends a string with a given paragraph style and font to this string.
- (void)appendString:(NSString *)string withParagraphStyle:(DTCoreTextParagraphStyle *)paragraphStyle fontDescriptor:(DTCoreTextFontDescriptor *)fontDescriptor
Parameters
- 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.h
removeHTMLAttribute:range:
Adds the custom HTML attributes with the given value from the given range.
- (void)removeHTMLAttribute:(NSString *)name range:(NSRange)range
Parameters
- name
The name of the custom HTML attribute
- range
The range to add the custom attribute for
Declared In
NSMutableAttributedString+HTML.h