Print end tag for self-closing tag #113

This commit is contained in:
Jim Derry 2014-11-22 20:08:00 +08:00
commit 08d490f406

View file

@ -1302,6 +1302,9 @@ static Bool AfterSpace(Lexer *lexer, Node *node)
return AfterSpaceImp(lexer, node, TY_(nodeCMIsEmpty)(node)); return AfterSpaceImp(lexer, node, TY_(nodeCMIsEmpty)(node));
} }
static void PPrintEndTag( TidyDocImpl* doc, uint ARG_UNUSED(mode),
uint ARG_UNUSED(indent), Node *node );
static void PPrintTag( TidyDocImpl* doc, static void PPrintTag( TidyDocImpl* doc,
uint mode, uint indent, Node *node ) uint mode, uint indent, Node *node )
{ {
@ -1344,7 +1347,12 @@ static void PPrintTag( TidyDocImpl* doc,
AddChar( pprint, '>' ); AddChar( pprint, '>' );
if ( (node->type != StartEndTag || xhtmlOut) && !(mode & PREFORMATTED) ) if (node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50)
{
PPrintEndTag( doc, mode, indent, node );
}
if ( (node->type != StartEndTag || xhtmlOut || (node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50)) && !(mode & PREFORMATTED) )
{ {
uint wraplen = cfg( doc, TidyWrapLen ); uint wraplen = cfg( doc, TidyWrapLen );
CheckWrapIndent( doc, indent ); CheckWrapIndent( doc, indent );