Skip to content
Browse files

HTML Writer reports that lists may only contain list items.

  • Loading branch information...
1 parent 7be2bfe commit 05b69fdad018b5dae0a5dcb5f52a68bf3707ba66 @mikeabdullah mikeabdullah committed Sep 18, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 KSHTMLWriter.m
View
15 KSHTMLWriter.m
@@ -446,6 +446,21 @@ - (BOOL)canWriteElementInline:(NSString *)tagName;
return [super canWriteElementInline:tagName];
}
+- (BOOL)validateElement:(NSString *)element;
+{
+ if (![super validateElement:element]) return NO;
+
+ // Lists can only contain list items
+ if ([self topElementIsList])
+ {
+ return [element isEqualToString:@"li"];
+ }
+ else
+ {
+ return YES;
+ }
+}
+
#pragma mark Element Primitives
- (void)startElement:(NSString *)elementName writeInline:(BOOL)writeInline; // for more control

0 comments on commit 05b69fd

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