Skip to content

Should unwrapped markup be allowed? #44

@TheJaredWilcurt

Description

@TheJaredWilcurt

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions