Currently there is a validation check, where if you pass in a a string of HTML as "data", it must begin with a <. As all HTML documents should start with <!DOCTYPE html> or <html> or even just <div>.
Though technically, if we are allowing someone to pass this in:
<div>
Some text <span class="cow">Moo</span>.
</div>
and converting it to
<html>
<head></head>
<body>
<div>
Some text <span class="rp__0 rp__1">Moo</span>.
</div>
</body>
</html>
Why not just allow Some text <span class="rp__0 rp__1">Moo</span>. to be passed in? the outcome is the same without the div wrapper?
What would be a use case for this?
Perhaps just validating that it is a string is good enough?
Currently there is a validation check, where if you pass in a a string of HTML as "data", it must begin with a
<. As all HTML documents should start with<!DOCTYPE html>or<html> or even just<div>.Though technically, if we are allowing someone to pass this in:
and converting it to
Why not just allow
Some text <span class="rp__0 rp__1">Moo</span>.to be passed in? the outcome is the same without the div wrapper?What would be a use case for this?
Perhaps just validating that it is a string is good enough?