lambda-fairy / maud

:pencil: Compile-time HTML templates for Rust
https://maud.lambda.xyz
Apache License 2.0
1.98k stars 132 forks source link

Compiler error? #394

Closed FallBackITA27 closed 8 months ago

FallBackITA27 commented 8 months ago

for some reason, whenever the div.text.dispnameclass element has children, the compiler logs out "error: expected `;`, found end of macro"


fn card(vars: UserData) -> maud::Markup {

    let dispname_class = vars.display_name.clone().to_ascii_lowercase().replace(' ', "_");
    maud::html! {
        img .pfp .(dispname_class) src=(vars.pfp_url) alt="pfp";
        .text .(dispname_class) {
            h2 { vars.display_name };
            p { maud::PreEscaped(vars.text) };
        };
    }

}
FallBackITA27 commented 8 months ago

extra context



struct UserData<'a> {
    name: &'a str,
    group: Group,
    text: &'a str,
    pfp_url: &'a str,
    display_name: &'a str,
}

enum Group {
    MainTeam,
    Translators,
    OldKept,
    MinorCredits
}
FallBackITA27 commented 8 months ago

I'm just a moron, forgot parenthesis.

jonas-w commented 4 months ago

I'm just a moron, forgot parenthesis.

haha thanks! I made the same mistake