Merge pull request #39 from stevenle/master
Remove <wbr> as a proprietary tag.
This commit is contained in:
commit
68a9e741a1
31
src/tags.c
31
src/tags.c
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
CVS Info :
|
CVS Info :
|
||||||
|
|
||||||
$Author: hoehrmann $
|
$Author: hoehrmann $
|
||||||
$Date: 2008/08/09 11:55:27 $
|
$Date: 2008/08/09 11:55:27 $
|
||||||
$Revision: 1.71 $
|
$Revision: 1.71 $
|
||||||
|
|
||||||
The HTML tags are stored as 8 bit ASCII strings.
|
The HTML tags are stored as 8 bit ASCII strings.
|
||||||
|
|
||||||
|
@ -277,7 +277,6 @@ static const Dict tag_defs[] =
|
||||||
{ TidyTag_SERVER, "server", VERS_NETSCAPE, NULL, (CM_HEAD|CM_MIXED|CM_BLOCK|CM_INLINE), TY_(ParseScript), NULL },
|
{ TidyTag_SERVER, "server", VERS_NETSCAPE, NULL, (CM_HEAD|CM_MIXED|CM_BLOCK|CM_INLINE), TY_(ParseScript), NULL },
|
||||||
{ TidyTag_SERVLET, "servlet", VERS_SUN, NULL, (CM_OBJECT|CM_IMG|CM_INLINE|CM_PARAM), TY_(ParseBlock), NULL },
|
{ TidyTag_SERVLET, "servlet", VERS_SUN, NULL, (CM_OBJECT|CM_IMG|CM_INLINE|CM_PARAM), TY_(ParseBlock), NULL },
|
||||||
{ TidyTag_SPACER, "spacer", VERS_NETSCAPE, NULL, (CM_INLINE|CM_EMPTY), TY_(ParseEmpty), NULL },
|
{ TidyTag_SPACER, "spacer", VERS_NETSCAPE, NULL, (CM_INLINE|CM_EMPTY), TY_(ParseEmpty), NULL },
|
||||||
{ TidyTag_WBR, "wbr", VERS_PROPRIETARY, NULL, (CM_INLINE|CM_EMPTY), TY_(ParseEmpty), NULL },
|
|
||||||
|
|
||||||
/* HTML5 */
|
/* HTML5 */
|
||||||
{ TidyTag_ARTICLE, "article", VERS_ELEM_ARTICLE, &TY_(W3CAttrsFor_ARTICLE)[0], (CM_BLOCK), TY_(ParseBlock), NULL },
|
{ TidyTag_ARTICLE, "article", VERS_ELEM_ARTICLE, &TY_(W3CAttrsFor_ARTICLE)[0], (CM_BLOCK), TY_(ParseBlock), NULL },
|
||||||
|
@ -305,7 +304,7 @@ static const Dict tag_defs[] =
|
||||||
{ TidyTag_TIME, "time", VERS_ELEM_TIME, &TY_(W3CAttrsFor_TIME)[0], (CM_INLINE), TY_(ParseInline), NULL },
|
{ TidyTag_TIME, "time", VERS_ELEM_TIME, &TY_(W3CAttrsFor_TIME)[0], (CM_INLINE), TY_(ParseInline), NULL },
|
||||||
{ TidyTag_TRACK, "track", VERS_ELEM_TRACK, &TY_(W3CAttrsFor_TRACK)[0], (CM_BLOCK|CM_EMPTY), TY_(ParseBlock), NULL },
|
{ TidyTag_TRACK, "track", VERS_ELEM_TRACK, &TY_(W3CAttrsFor_TRACK)[0], (CM_BLOCK|CM_EMPTY), TY_(ParseBlock), NULL },
|
||||||
{ TidyTag_VIDEO, "video", VERS_ELEM_VIDEO, &TY_(W3CAttrsFor_VIDEO)[0], (CM_BLOCK|CM_INLINE), TY_(ParseBlock), NULL },
|
{ TidyTag_VIDEO, "video", VERS_ELEM_VIDEO, &TY_(W3CAttrsFor_VIDEO)[0], (CM_BLOCK|CM_INLINE), TY_(ParseBlock), NULL },
|
||||||
{ TidyTag_WBR, "wbr", VERS_ELEM_WBR, &TY_(W3CAttrsFor_VIDEO)[0], (CM_INLINE|CM_EMPTY), TY_(ParseEmpty), NULL },
|
{ TidyTag_WBR, "wbr", VERS_ELEM_WBR, &TY_(W3CAttrsFor_WBR)[0], (CM_INLINE|CM_EMPTY), TY_(ParseEmpty), NULL },
|
||||||
|
|
||||||
/* this must be the final entry */
|
/* this must be the final entry */
|
||||||
{ (TidyTagId)0, NULL, 0, NULL, (0), NULL, NULL }
|
{ (TidyTagId)0, NULL, 0, NULL, (0), NULL, NULL }
|
||||||
|
@ -350,7 +349,7 @@ static void tagsRemoveFromHash( TidyDocImpl* doc, TidyTagImpl* tags, ctmbstr s )
|
||||||
{
|
{
|
||||||
DictHash* next = p->next;
|
DictHash* next = p->next;
|
||||||
if ( prev )
|
if ( prev )
|
||||||
prev->next = next;
|
prev->next = next;
|
||||||
else
|
else
|
||||||
tags->hashtab[h] = next;
|
tags->hashtab[h] = next;
|
||||||
TidyDocFree(doc, p);
|
TidyDocFree(doc, p);
|
||||||
|
@ -446,7 +445,7 @@ static void FreeDict( TidyDocImpl* doc, Dict *d )
|
||||||
}
|
}
|
||||||
|
|
||||||
static void declare( TidyDocImpl* doc, TidyTagImpl* tags,
|
static void declare( TidyDocImpl* doc, TidyTagImpl* tags,
|
||||||
ctmbstr name, uint versions, uint model,
|
ctmbstr name, uint versions, uint model,
|
||||||
Parser *parser, CheckAttribs *chkattrs )
|
Parser *parser, CheckAttribs *chkattrs )
|
||||||
{
|
{
|
||||||
if ( name )
|
if ( name )
|
||||||
|
@ -486,7 +485,7 @@ Bool TY_(FindTag)( TidyDocImpl* doc, Node *node )
|
||||||
node->tag = np;
|
node->tag = np;
|
||||||
return yes;
|
return yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
return no;
|
return no;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,7 +497,7 @@ const Dict* TY_(LookupTagDef)( TidyTagId tid )
|
||||||
if (np->id == tid)
|
if (np->id == tid)
|
||||||
return np;
|
return np;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Parser* TY_(FindParser)( TidyDocImpl* doc, Node *node )
|
Parser* TY_(FindParser)( TidyDocImpl* doc, Node *node )
|
||||||
|
@ -573,7 +572,7 @@ ctmbstr TY_(GetNextDeclaredTag)( TidyDocImpl* ARG_UNUSED(doc),
|
||||||
curr->parser == TY_(ParseBlock) )
|
curr->parser == TY_(ParseBlock) )
|
||||||
name = curr->name;
|
name = curr->name;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case tagtype_pre:
|
case tagtype_pre:
|
||||||
if ( (curr->model & CM_BLOCK) != 0 &&
|
if ( (curr->model & CM_BLOCK) != 0 &&
|
||||||
curr->parser == TY_(ParsePre) )
|
curr->parser == TY_(ParsePre) )
|
||||||
|
@ -703,7 +702,7 @@ void CheckIMG( TidyDocImpl* doc, Node *node )
|
||||||
doc->badAccess |= BA_MISSING_IMAGE_ALT;
|
doc->badAccess |= BA_MISSING_IMAGE_ALT;
|
||||||
TY_(ReportMissingAttr)( doc, node, "alt" );
|
TY_(ReportMissingAttr)( doc, node, "alt" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( cfgStr(doc, TidyAltText) )
|
if ( cfgStr(doc, TidyAltText) )
|
||||||
TY_(AddAttribute)( doc, node, "alt", cfgStr(doc, TidyAltText) );
|
TY_(AddAttribute)( doc, node, "alt", cfgStr(doc, TidyAltText) );
|
||||||
}
|
}
|
||||||
|
@ -818,7 +817,7 @@ Bool TY_(nodeHasText)( TidyDocImpl* doc, Node* node )
|
||||||
|
|
||||||
Bool TY_(nodeIsElement)( Node* node )
|
Bool TY_(nodeIsElement)( Node* node )
|
||||||
{
|
{
|
||||||
return ( node &&
|
return ( node &&
|
||||||
(node->type == StartTag || node->type == StartEndTag) );
|
(node->type == StartTag || node->type == StartEndTag) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -828,7 +827,7 @@ Bool TY_(nodeIsElement)( Node* node )
|
||||||
*/
|
*/
|
||||||
Bool nodeMatchCM( Node* node, uint contentModel )
|
Bool nodeMatchCM( Node* node, uint contentModel )
|
||||||
{
|
{
|
||||||
return ( node && node->tag &&
|
return ( node && node->tag &&
|
||||||
(node->tag->model & contentModel) == contentModel );
|
(node->tag->model & contentModel) == contentModel );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -837,7 +836,7 @@ Bool nodeMatchCM( Node* node, uint contentModel )
|
||||||
*/
|
*/
|
||||||
Bool TY_(nodeHasCM)( Node* node, uint contentModel )
|
Bool TY_(nodeHasCM)( Node* node, uint contentModel )
|
||||||
{
|
{
|
||||||
return ( node && node->tag &&
|
return ( node && node->tag &&
|
||||||
(node->tag->model & contentModel) != 0 );
|
(node->tag->model & contentModel) != 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -860,8 +859,8 @@ Bool TY_(nodeIsHeader)( Node* node )
|
||||||
return ( tid && (
|
return ( tid && (
|
||||||
tid == TidyTag_H1 ||
|
tid == TidyTag_H1 ||
|
||||||
tid == TidyTag_H2 ||
|
tid == TidyTag_H2 ||
|
||||||
tid == TidyTag_H3 ||
|
tid == TidyTag_H3 ||
|
||||||
tid == TidyTag_H4 ||
|
tid == TidyTag_H4 ||
|
||||||
tid == TidyTag_H5 ||
|
tid == TidyTag_H5 ||
|
||||||
tid == TidyTag_H6 ));
|
tid == TidyTag_H6 ));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue