forked from nolanw/HTMLReader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNSString+HTMLEntities.h
More file actions
23 lines (15 loc) · 811 Bytes
/
NSString+HTMLEntities.h
File metadata and controls
23 lines (15 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// NSString+HTMLEntities.h
//
// Public domain. https://github.com/nolanw/HTMLReader
#import <HTMLReader/HTMLSupport.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSString (HTMLEntities)
/**
Returns a copy of the string with the necessary characters escaped for HTML.
For more information, see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#escapingString (the algorithm is not invoked in the "attribute mode").
*/
@property (readonly, copy, nonatomic) NSString *html_stringByEscapingForHTML;
/// Returns a copy of the string with all recognized HTML entities replaced by their respective code points. If no replacement is necessary, the same instance may be returned.
@property (readonly, copy, nonatomic) NSString *html_stringByUnescapingHTML;
@end
NS_ASSUME_NONNULL_END