Browse Source
Certain start tags (a, area, img, map) do not make sense unless they have at least one attribute present. If a completely attribute barren start tag for one of these elements is found, treat it as invalid and escape the leading '<'. This is an heuristic that shouldn't cause too many problems while silently "correcting" incorrect input. Either way (leaving the bare start tag with no attributes or escaping it and potentially causing a fault as its end tag no longer has anything to match up with), it's broken. The question becomes then which breakage is more common in order to handle that one in preference to the other. With this change, the "it wasn't really a tag after all" situation will now be considered more common than the "it was deliberatly an invalid start tag with a matching end tag" situation. Signed-off-by: Kyle J. McKay <mackyle@gmail.com>master
Kyle J. McKay
5 years ago
1 changed files with 4 additions and 1 deletions
Loading…
Reference in new issue