Skip to content

Commit 9b031be

Browse files
committed
fix: better class namings
1 parent e748f28 commit 9b031be

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

ios/inputParser/EnrichedHTMLParser.h renamed to ios/inputParser/EnrichedAttributedStringHTMLSerializer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@class HTMLNode;
44
@class HTMLTextNode;
55

6-
@interface EnrichedHTMLParser : NSObject
6+
@interface EnrichedAttributedStringHTMLSerializer : NSObject
77
- (instancetype)initWithStyles:(NSDictionary<NSNumber *, id> *)stylesDict;
88
- (NSString *)buildHtmlFromAttributedString:(NSAttributedString *)text
99
pretify:(BOOL)pretify;

ios/inputParser/EnrichedHTMLParser.mm renamed to ios/inputParser/EnrichedAttributedStringHTMLSerializer.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#import "EnrichedHtmlParser.h"
2-
#import "EnrichedHTMLTagUtils.h"
1+
#import "EnrichedAttributedStringHTMLSerializer.h"
2+
#import "EnrichedAttributedStringHTMLSerializerTagUtils.h"
33
#import "HtmlNode.h"
44
#import "StyleHeaders.h"
55

6-
@implementation EnrichedHTMLParser {
6+
@implementation EnrichedAttributedStringHTMLSerializer {
77
NSDictionary<NSNumber *, id<BaseStyleProtocol>> *_styles;
88
NSArray<id<BaseStyleProtocol>> *_inlineStyles;
99
NSArray<id<BaseStyleProtocol>> *_paragraphStyles;

ios/inputParser/EnrichedHTMLTagUtils.h renamed to ios/inputParser/EnrichedAttributedStringHTMLSerializerTagUtils.h

File renamed without changes.

ios/inputParser/InputParser.mm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#import "InputParser.h"
2-
#import "EnrichedHTMLParser.h"
2+
#import "EnrichedAttributedStringHTMLSerializer.h"
33
#import "EnrichedTextInputView.h"
44
#import "StringExtension.h"
55
#import "StyleHeaders.h"
@@ -8,21 +8,24 @@
88

99
@implementation InputParser {
1010
EnrichedTextInputView *_input;
11-
EnrichedHTMLParser *_htmlParser;
11+
EnrichedAttributedStringHTMLSerializer *_attributedStringHTMLSerializer;
1212
}
1313

1414
- (instancetype)initWithInput:(id)input {
1515
self = [super init];
1616
_input = (EnrichedTextInputView *)input;
17-
_htmlParser = [[EnrichedHTMLParser alloc] initWithStyles:_input->stylesDict];
17+
_attributedStringHTMLSerializer =
18+
[[EnrichedAttributedStringHTMLSerializer alloc]
19+
initWithStyles:_input->stylesDict];
1820
return self;
1921
}
2022

2123
- (NSString *)parseToHtmlFromRange:(NSRange)range {
2224
NSAttributedString *sub =
2325
[_input->textView.textStorage attributedSubstringFromRange:range];
2426

25-
return [_htmlParser buildHtmlFromAttributedString:sub pretify:YES];
27+
return [_attributedStringHTMLSerializer buildHtmlFromAttributedString:sub
28+
pretify:YES];
2629
}
2730

2831
- (void)replaceWholeFromHtml:(NSString *_Nonnull)html {

0 commit comments

Comments
 (0)