Is space legal after angle brackets?

I am creating slicer to deserialize html and xml. The question is, is it legal in any language to put a space after the angle bracket and still consider it a tag? for instance

< div>

Or should I just consider this simple text?

And yes, I tried searching the Internet for this, but even after browsing through w3 I could not determine the explicit answer.

+4
source share
2 answers

The WHATWG HTML specification indicates that the tag name immediately follows the opening bracket.

The W3C XML specification has the same requirements.

, . . :

<p           ></p         >
<p
></p>
+8

, ,

,

<html>
<head>
</head>
<body>
<h1>Hey sup man</h1>
< div><p>hey sup</p></div>
</body>
</html>

,

Hey sup man

< div>
hey sup
+1

All Articles