Allow for attributes in <li> tags.
parse_tag() is called both for attributes inside a tag and the end of the tag itself. For most tags parse_tag() doesn't distinguish both cases. This means that the "tag action" is additionally triggered for every tag attribute. When the tag "action" is setting some state this doesn't hurt. For many tags the "tag action" is to render a newline. Superfluous newlines are sort of acceptable to keep the code as small as possible. However the <li> "tag action" is to render a newline followed by an asterisk - and superfluous asterisks are ugly so we check for <li> if parse_tag() was called for the end of the tag itself.
This commit is contained in:
parent
a9f88a05d6
commit
980d055f72
|
@ -390,9 +390,11 @@ parse_tag(void)
|
|||
newline();
|
||||
break;
|
||||
case TAG_LI:
|
||||
newline();
|
||||
add_char(ISO_asterisk);
|
||||
add_char(ISO_space);
|
||||
if(s.tagattr[0] == 0) {
|
||||
newline();
|
||||
add_char(ISO_asterisk);
|
||||
add_char(ISO_space);
|
||||
}
|
||||
break;
|
||||
case TAG_SCRIPT:
|
||||
case TAG_STYLE:
|
||||
|
|
Loading…
Reference in a new issue