Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should unwrapped markup be allowed? #44

Open
TheJaredWilcurt opened this issue Dec 20, 2020 · 1 comment
Open

Should unwrapped markup be allowed? #44

TheJaredWilcurt opened this issue Dec 20, 2020 · 1 comment

Comments

@TheJaredWilcurt
Copy link
Member

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?

@TheJaredWilcurt
Copy link
Member Author

Relates to #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Red Perfume
  
Backlog
Development

No branches or pull requests

1 participant