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

Escaping doesn't work well #30

Closed
clinyong opened this issue Nov 12, 2014 · 2 comments
Closed

Escaping doesn't work well #30

clinyong opened this issue Nov 12, 2014 · 2 comments

Comments

@clinyong
Copy link

@variable will automatically escape the variable, but I found that the escaping doesn't work in layout.

@clinyong
Copy link
Author

The template file, it depends on the layout.

@{
    import {
        "tpl/user/layout/base"
    }

    <div>
        @user.Name
    </div>
}

The layout file, base.gohtml

@{
    var body string
}

<!DOCTYPE html>
<html lang="en">
    <head></head>
    <body>
       @body
       <div>@user.Name</div>
    </body>
</html>

If user.Name is Leo<div> , in the layout file, the @body is Leo&lt;div&gt;, but the @user.Name is Leo<div>.

@Wuvist
Copy link
Member

Wuvist commented Dec 1, 2014

fixed in 832cad0

@Wuvist Wuvist closed this as completed Dec 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants