Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Only ordered list items can have a value.

  • Loading branch information...
commit a85616df445c31e12971dd41dddf65071cdae719 1 parent afc5463
@mikeabdullah mikeabdullah authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 KSHTMLWriter.m
View
14 KSHTMLWriter.m
@@ -461,6 +461,20 @@ - (BOOL)validateElement:(NSString *)element;
}
}
+- (NSString *)validateAttribute:(NSString *)name value:(NSString *)value ofElement:(NSString *)element;
+{
+ NSString *result = [super validateAttribute:name value:value ofElement:element];
+ if (!result) return nil;
+
+ // value is only allowed as a list item attribute when in an ordered list
+ if ([element isEqualToString:@"li"] && [name isEqualToString:@"value"])
+ {
+ if (![[self topElement] isEqualToString:@"ol"]) result = nil;
+ }
+
+ return result;
+}
+
#pragma mark Element Primitives
- (void)startElement:(NSString *)elementName writeInline:(BOOL)writeInline; // for more control
Please sign in to comment.
Something went wrong with that request. Please try again.