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

When a value of STATE in the second level or more is HTML, Metal escapes #381

Open
matuzalemsteles opened this issue May 30, 2018 · 0 comments

Comments

@matuzalemsteles
Copy link
Contributor

Summary

Metal treats only the first level value for html in STATE in soy, there are cases with values in the second level or more that can accept html.

Use case

Consider:

App.STATE = {
    sections: Config.arrayOf(Config.shapeOf({
       htmlContent: Config.any(),
    })),
};

Soy:

{@param sections: list<[
    htmlContent: html
]>}

Validating Metal to check for an html happens in Soy.js#L137 Soy.js#L57 the way we check it requires it to be only on the first level.

Consider:

App.STATE = {
    sections: {
        value: [
            {
                htmlContent: {
                    isHtml: true,
                }
            }
        ]
    },
};

Even if we put isHtml the validation of Metal requires that it be in the first level, see Soy.js#L129.

Maybe we have to change the way we will check this in the state, the problem can be more complicated, it has to be studied.

Expected behavior

Second-level values or more in the Html state value must be rendered.

Current behavior

Metal escapes the contents of htmlContent with html and does not treat.

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

1 participant