Skip to content
Browse files

Don't bother exposing -[KSHTMLWriter elementClassName]. Can use [[[wr…

…iter currentElementInfo] attributesAsDictionary] objectForKey:@"class"] instead.
  • Loading branch information...
1 parent 3aeccf6 commit 5df9cd74ef455701382b1216ca382ff285fe0452 @mikeabdullah mikeabdullah committed Nov 19, 2010
Showing with 8 additions and 9 deletions.
  1. +0 −1 KSHTMLWriter.h
  2. +8 −8 KSHTMLWriter.m
View
1 KSHTMLWriter.h
@@ -57,7 +57,6 @@
// Class names are accumulated and written automatically as an attribute of the next element started
// You can also push a class name using -pushAttribute:value: if attribute is 'class'
- (void)pushClassName:(NSString *)className;
-- (NSString *)elementClassName;
#pragma mark HTML Fragments
View
16 KSHTMLWriter.m
@@ -77,12 +77,7 @@ - (void)startDocument:(NSString *)DTD encoding:(NSStringEncoding)encoding isXHTM
#pragma mark CSS Class Name
-- (void)pushClassName:(NSString *)className;
-{
- [_classNames addObject:className];
-}
-
-- (NSString *)elementClassName;
+- (NSString *)currentElementClassName;
{
NSString *result = nil;
if ([_classNames count])
@@ -92,6 +87,11 @@ - (NSString *)elementClassName;
return result;
}
+- (void)pushClassName:(NSString *)className;
+{
+ [_classNames addObject:className];
+}
+
- (void)pushAttribute:(NSString *)attribute value:(id)value;
{
if ([attribute isEqualToString:@"class"])
@@ -109,7 +109,7 @@ - (KSElementInfo *)currentElementInfo;
KSElementInfo *result = [super currentElementInfo];
// Add in buffered class info
- NSString *class = [self elementClassName];
+ NSString *class = [self currentElementClassName];
if (class) [result addAttribute:@"class" value:class];
return result;
@@ -368,7 +368,7 @@ - (void)startElement:(NSString *)elementName writeInline:(BOOL)writeInline; // f
// Add in any pre-written classes
- NSString *class = [self elementClassName];
+ NSString *class = [self currentElementClassName];
if (class)
{
[_classNames removeAllObjects];

0 comments on commit 5df9cd7

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