forked from Cocoanetics/DTCoreText
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NSAttributedString+HTML.h
47 lines (39 loc) · 1.95 KB
/
NSAttributedString+HTML.h
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
//
// NSAttributedString+HTML.h
// CoreTextExtensions
//
// Created by Oliver Drobnik on 1/9/11.
// Copyright 2011 Drobnik.com. All rights reserved.
//
@class NSAttributedString;
/**
Methods for generating an `NSAttributedString` from HTML data. Those methods exist on Mac but have not been ported (publicly) to iOS. This project aims to remedy this.
*/
@interface NSAttributedString (HTML)
/**
@name Creating an NSAttributedString
*/
/**
Initializes and returns a new `NSAttributedString` object from the HTML contained in the given object and base URL.
@param data The data in HTML format from which to create the attributed string.
@param docAttributes Currently not in used.
@returns Returns an initialized object, or `nil` if the data can’t be decoded.
*/
- (id)initWithHTMLData:(NSData *)data documentAttributes:(NSDictionary **)docAttributes;
/**
Initializes and returns a new `NSAttributedString` object from the HTML contained in the given object and base URL.
@param data The data in HTML format from which to create the attributed string.
@param baseURL An `NSURL` that represents the base URL for all links within the HTML.
@param docAttributes Currently not in used.
@returns Returns an initialized object, or `nil` if the data can’t be decoded.
*/
- (id)initWithHTMLData:(NSData *)data baseURL:(NSURL *)baseURL documentAttributes:(NSDictionary **)docAttributes;
/**
Initializes and returns a new `NSAttributedString` object from the HTML contained in the given object and base URL.
@param data The data in HTML format from which to create the attributed string.
@param options Specifies how the document should be loaded. Contains values described in “Option keys for importing documents.”
@param docAttributes Currently not in used.
@returns Returns an initialized object, or `nil` if the data can’t be decoded.
*/
- (id)initWithHTMLData:(NSData *)data options:(NSDictionary *)options documentAttributes:(NSDictionary **)docAttributes;
@end