From 9c6799dfbdaf9f067fc49b0c8b68ba8e07dddc29 Mon Sep 17 00:00:00 2001 From: Nicolas Goutaland Date: Thu, 4 May 2017 18:46:50 +0200 Subject: [PATCH] Fixed extraneous newline character in lu --- Classes/GONMarkupListItem.m | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Classes/GONMarkupListItem.m b/Classes/GONMarkupListItem.m index 76d8c85..ab7ec08 100644 --- a/Classes/GONMarkupListItem.m +++ b/Classes/GONMarkupListItem.m @@ -78,14 +78,13 @@ - (NSAttributedString *)prefixStringForContext:(NSMutableDictionary *)context at else prefix = [self unorderedListItemPrefixForIndentation:indentation position:position listConfiguration:listConfiguration context:context]; + // Force new line + if (position != 0) + prefix = [@"\n" stringByAppendingString:prefix]; + return [[NSAttributedString alloc] initWithString:prefix attributes:stringAttributes]; } -- (NSAttributedString *)suffixStringForContext:(NSMutableDictionary *)context attributes:(NSDictionary *)dicAttributes stringAttributes:(NSDictionary *)stringAttributes -{ - return [[NSAttributedString alloc] initWithString:@"\n"]; -} - #pragma mark - Utils - (NSMutableParagraphStyle *)paragraphStyle:(NSMutableDictionary *)configurationDictionary {