问题
i do want to build a validator for HTML tagname ,
vdAPI.get({module:'html',subject:'tag'}).validator=function (tag){
return !vdAPI.nottags.contains(tag) && (tag.length>0 && tag.length <= vdAPI.MAX_LENGTH_TAG)
}
What is the suitable value of vdAPI.MAX_LENGTH_TAG
?
回答1:
From the w3.org:
The algorithm described below places no limit on the depth of the DOM tree generated, or on the length of tag names, attribute names, attribute values, Text nodes, etc. While implementors are encouraged to avoid arbitrary limits, it is recognized that practical concerns will likely force user agents to impose nesting depth constraints.
来源:https://stackoverflow.com/questions/28607977/does-html-tag-name-has-a-max-size-length