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

Leptosfmt adds stray space in html shell (needed for leptos-0.7*) #146

Closed
spencewenski opened this issue Sep 25, 2024 · 0 comments · Fixed by #147
Closed

Leptosfmt adds stray space in html shell (needed for leptos-0.7*) #146

spencewenski opened this issue Sep 25, 2024 · 0 comments · Fixed by #147

Comments

@spencewenski
Copy link

spencewenski commented Sep 25, 2024

Context

In leptos-0.7 we can (need to?) provide a custom "app shell". This typically looks something like:

pub fn shell(options: LeptosOptions) -> impl IntoView {
    view! {
        <!DOCTYPE html>
        <html lang="en"></html>
    }
}

See also many of the examples, e.g. the hackernews_axum example.

Bug

The issue I'm seeing is leptosfmt is adding a space ( ) after the <!DOCTYPE html>. This then causes cargo fmt --all --check to fail due to the trailing whitespace. E.g, the example above becomes (note the trailing ):

pub fn shell(options: LeptosOptions) -> impl IntoView {
    view! {
        <!DOCTYPE html> 
        <html lang="en"></html>
    }
}

If I try running cargo fmt after leptosfmt, then leptosfmt --check fails because it expects the trailing whitespace.

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

Successfully merging a pull request may close this issue.

1 participant