From 42508f56c5026efd969eb88e553dbb879e22e50d Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Thu, 4 Nov 2004 17:25:44 +0000 Subject: [w3m-dev 04117] Re: start attribute and value attribute on ordered lists * file.c (HTMLtagproc1): allow negative value for start attr From: Hiroyuki Ito --- file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 18346e9..7869dcb 100644 --- a/file.c +++ b/file.c @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.235 2004/04/16 18:47:19 ukai Exp $ */ +/* $Id: file.c,v 1.236 2004/11/04 17:25:45 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" @@ -4180,7 +4180,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) } PUSH_ENV(cmd); if (cmd == HTML_UL || cmd == HTML_OL) { - if (parsedtag_get_value(tag, ATTR_START, &count) && count > 0) { + if (parsedtag_get_value(tag, ATTR_START, &count)) { envs[h_env->envc].count = count - 1; } } @@ -4239,6 +4239,8 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) count = atoi(p); if (count > 0) envs[h_env->envc].count = count; + else + envs[h_env->envc].count = 0; } switch (envs[h_env->envc].env) { case HTML_UL: @@ -4272,7 +4274,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) case HTML_OL: if (parsedtag_get_value(tag, ATTR_TYPE, &p)) envs[h_env->envc].type = (int)*p; - switch (envs[h_env->envc].type) { + switch ((envs[h_env->envc].count > 0)? envs[h_env->envc].type: '1') { case 'i': num = romanNumeral(envs[h_env->envc].count); break; -- cgit v1.2.3