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

Content.Page and HTML escaping #1023

Closed
granicz opened this Issue Sep 13, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@granicz
Member

granicz commented Sep 13, 2018

There are a couple issues here. Assume res is a string value containing a valid HTML document, such as:

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Welcome</title>
</head>
<body>
    <div class="container" id="main">
        <div class="page-header">
            <h1>Hello world!</h1>
        </div>
        <div class="col-md-9">
            Content here
        </div>
    </div>
</body>
</html>
  1. Content.Page(div [] [text res]) returns:
    <!DOCTYPE html>
    <div><!DOCTYPE html>
    <html lang="en">
    <head>
        <title>Welcome</title>
    </head>
    <body>
        <div class="container" id="main">
            <div class="page-header">
                <h1>Hello world!</h1>
            </div>
            <div class="col-md-9">
                Content here
            </div>
        </div>
    </body>
    </html>
    </div>
  2. Content.Page([div [] [text res]]) returns:
    <!DOCTYPE html>
    <html><head><meta id='websharper-data' name='websharper-data' content='{"$TYPES":[],"$DATA":{"$V":{}}}' />
    <script src="/Scripts/WebSharper/WebSharper.Core.JavaScript/Runtime.min.js" type="text/javascript" charset="UTF-8"></script><script type="text/javascript">
    if (typeof IntelliFactory !=='undefined') {
      IntelliFactory.Runtime.ScriptBasePath = '/Scripts/WebSharper/';
      IntelliFactory.Runtime.Start();
    }
    </script>
    </head><body><div><!DOCTYPE html>
    <html lang="en">
    <head>
        <title>Welcome</title>
    </head>
    <body>
        <div class="container" id="main">
            <div class="page-header">
                <h1>Hello world!</h1>
            </div>
            <div class="col-md-9">
                Content here
            </div>
        </div>
    </body>
    </html>
    </div></body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment