Skip to content
Browse files

moved iPhone special case define to pch, hoping that somebody might f…

…ix the unit tests. Updated Read Me.
  • Loading branch information...
1 parent fcbdce4 commit 37cf3a664b17cf6103b7b16988f97de2fe68ae2c @odrobnik odrobnik committed
Showing with 8 additions and 27 deletions.
  1. +3 −18 Classes/NSAttributedString+HTML.m
  2. +0 −3 Other Sources/CoreTextExtensions_Prefix.pch
  3. +5 −6 Resources/README.html
View
21 Classes/NSAttributedString+HTML.m
@@ -90,8 +90,10 @@ - (id)initWithHTML:(NSData *)data options:(NSDictionary *)options documentAttrib
NSMutableArray *tagStack = [NSMutableArray array];
// NSMutableDictionary *fontCache = [NSMutableDictionary dictionaryWithCapacity:10];
-
+
+#if ALLOW_IPHONE_SPECIAL_CASES
CGFloat nextParagraphAdditionalSpaceBefore = 0.0;
+#endif
BOOL seenPreviousParagraph = NO;
NSInteger listCounter = 0; // Unordered, set to 1 to get ordered list
BOOL needsListItemStart = NO;
@@ -736,23 +738,6 @@ - (id)initWithHTML:(NSData *)data options:(NSDictionary *)options documentAttrib
}
}
-#if ADD_TAG_PATH
- // adds the path of the tag containing this string to the attribute dictionary
- NSMutableArray *tagPath = [[NSMutableArray alloc] init];
- for (NSDictionary *oneTag in tagStack)
- {
- NSString *tag = [oneTag objectForKey:@"_tag"];
- if (!tag)
- {
- tag = @"";
- }
- [tagPath addObject:tag];
- }
-
- [attributes setObject:[tagPath componentsJoinedByString:@"/"] forKey:@"Path"];
- [tagPath release];
-#endif
-
// we don't want whitespace before first tag to turn into paragraphs
if (![tagName isEqualToString:@"html"])
{
View
3 Other Sources/CoreTextExtensions_Prefix.pch
@@ -11,9 +11,6 @@
// Allows variations to cater for different behavior on iOS than OSX to have similar visual output
#define ALLOW_IPHONE_SPECIAL_CASES 1
-// adds the path of tags to attributes dict
-//#define ADD_TAG_PATH 1
-
/* Known Differences:
- OSX has an entire attributes block for an UL block
- OSX does not add extra space after UL block
View
11 Resources/README.html
@@ -10,18 +10,17 @@
<li>Underline <b>U</b></li>
<li>Superscript <b>SUP</b> and Subscript <b>SUB</b>, e.g. e = mc<sup>2</sup> (Drawing missing)</li>
<li>Strike Out <b>DEL</b>, e.g. <del>Something Removed</del></li>
-<li><b>FONT</b> (face,color and size 1-7). It would be great if we could support many more styles</li>
-<li>Images <b>IMG</b> (Online local files)</li>
-<li>Hyperlinks <b>A</b> (<a>Formatting</a> only, not clickable yet)</li>
+<li><b>FONT</b> (face,color and size 1-7)</li>
+<li>Horizontal Rule<b>HR</b> (coloring via background-color style, simplified)</li>
+<li>Hyperlinks <b>A</b> (<a>Formatting</a> only, clickable as custom view)</li>
<li>Unordered Lists <b>LI</b></li>
<li>Ordered Lists <b>OL</b></li></ul>
-<p>Currently attributes are inherited by enclosed tags via brute force. I don't know if this is accurate.</p>
+<p>Currently attributes are inherited from enclosed tags via brute force. I don't know if this is accurate.</p>
<h3>To Do</h3>
<h4>NSAttributedString+HTML</h4>
<ol>
-<li>Decode HTML Entities</li>
+<li>Variations of the HR tag, currently it's only drawn as single 1px line</li>
<li>More robust handling for inline versus block elements</li>
-<li>A HREF tags, to format links</li>
<li>More styles, as far as supported by CoreText</li>
</ol>
<h4>DTAttributedTextView</h4>

0 comments on commit 37cf3a6

Please sign in to comment.
Something went wrong with that request. Please try again.