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

char type is not escaped #125

Closed
Kogia-sima opened this issue Jun 4, 2020 · 1 comment · Fixed by #126
Closed

char type is not escaped #125

Kogia-sima opened this issue Jun 4, 2020 · 1 comment · Fixed by #126
Labels
bug Something isn't working

Comments

@Kogia-sima
Copy link

description

When char type is passed to template, it is not escaped.

Example

Template:

<h1>{{ content }}</h1>

Rust code:

use yarte::Template;

#[derive(Template)]
#[template(path = "example.hbs")]
struct Example {
    content: char
}

fn main() {
    let template = Example { content: '<' };
    println!("{}", template.call().unwrap());
}

Output:

<h1><</h1>
@zzau13
Copy link
Owner

zzau13 commented Jun 4, 2020

Yes, it does not escape. It is quite ineffective to pass v_escape. There should have been notice from the documentation, sorry. I'm going to put new features to v_escape including this one.

Thank you very much for warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants