Add HTML-escaping category method for NSString

Escapes HTML as described in:
https://html.spec.whatwg.org/multipage/parsing.html#escapingString
This commit is contained in:
iska
2018-05-10 23:11:32 +02:00
parent 9dd3c70fc3
commit 482d936196
3 changed files with 35 additions and 0 deletions
+7
View File
@@ -48,6 +48,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (NSUInteger)leadingHTMLWhitespaceLength;
/**
Escapes this string as specified in `https://html.spec.whatwg.org/multipage/parsing.html#escapingString`
@return A copy of this string by HTML-escaping this stirng.
*/
- (NSString *)stringByEscapingForHTML;
@end
NS_ASSUME_NONNULL_END