Browse files

Fixed start index being ignored for OL lists

closes #342
  • Loading branch information...
1 parent 0bc26e0 commit f69bdb399a44f5644cec1f14927d93cc314b3492 @odrobnik odrobnik committed Mar 23, 2013
Showing with 18 additions and 6 deletions.
  1. +11 −1 Core/Source/DTHTMLElement.m
  2. +7 −5 Demo/Resources/CurrentTest.html
View
12 Core/Source/DTHTMLElement.m
@@ -1084,7 +1084,17 @@ - (void)applyStyleDictionary:(NSDictionary *)styles
- (DTCSSListStyle *)listStyle
{
- return [[DTCSSListStyle alloc] initWithStyles:_styles];
+ DTCSSListStyle *style = [[DTCSSListStyle alloc] initWithStyles:_styles];
+
+ NSString *startingIndex = [_attributes objectForKey:@"start"];
+
+ // set the starting index if there is one specified
+ if (startingIndex)
+ {
+ style.startingItemNumber = [startingIndex integerValue];
+ }
+
+ return style;
}
- (void)addAdditionalAttribute:(id)attribute forKey:(id)key
View
12 Demo/Resources/CurrentTest.html
@@ -2,10 +2,12 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html40/strict.dtd">
<html>
<head>
- <style>
- a:active {color:#0000FF;} /* selected link */
- </style>
- <body ontouchstart="">
- <p style="font-family:'Times New Roman';font-size:50px">Some normal <u>unde</u> <a href="http://apple.com">U</a> and onwards</p>
+ <body>
+ <ol start="5">
+ <li>Item #5</li>
+ <li>Item #6</li>
+ <li>etc.</li>
+ </ol>
+
</body>
</html>

0 comments on commit f69bdb3

Please sign in to comment.