Skip to content

Commit

Permalink
Apply custom attribute name change
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekzaw committed Dec 9, 2024
1 parent 6cca5be commit bd5e3b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apple/MarkdownTextLayoutManagerDelegate.mm
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#import <RNLiveMarkdown/MarkdownTextLayoutManagerDelegate.h>
#import <RNLiveMarkdown/BlockquoteTextLayoutFragment.h>
#import <RNLiveMarkdown/MarkdownFormatter.h>

@implementation MarkdownTextLayoutManagerDelegate

- (NSTextLayoutFragment *)textLayoutManager:(NSTextLayoutManager *)textLayoutManager textLayoutFragmentForLocation:(id <NSTextLocation>)location inTextElement:(NSTextElement *)textElement
API_AVAILABLE(ios(15.0)){
NSInteger index = [textLayoutManager offsetFromLocation:textLayoutManager.documentRange.location toLocation:location];
if (index < self.textStorage.length) {
NSNumber *depth = [self.textStorage attribute:RCTLiveMarkdownBlockquoteAttributeName atIndex:index effectiveRange:nil];
NSNumber *depth = [self.textStorage attribute:RCTLiveMarkdownBlockquoteDepthAttributeName atIndex:index effectiveRange:nil];
if (depth != nil) {
BlockquoteTextLayoutFragment *textLayoutFragment = [[BlockquoteTextLayoutFragment alloc] initWithTextElement:textElement range:textElement.elementRange];
textLayoutFragment.markdownUtils = _markdownUtils;
Expand Down

0 comments on commit bd5e3b3

Please sign in to comment.