Closed AdamLeyshon closed 1 year ago
related #7
Thanks for reporting! I will try to look at this soon, meanwhile I recommend that you keep the raw json string outside the view! macro.
Albeit off-topic, I reckon that eventually you would like to use something like the json!
macro, so that you can insert dynamic values: https://github.com/serde-rs/json#constructing-json-values ?
Just merged #32 to main, which will keep original indentation with multiline quoted strings. (so 1. untouched). It does not format it's contents, I am not sure if I want to deal with external javascript formatters within this lib.
I honestly think you would be better of writing the script contents to a dedicated JS file so that you get proper editor support, highlighting, formatting etc, thoughts?
Package information:
Story: When a user has a
view!
macro which contains JSON/JS inside of a string literal enclosed by a script tag, Indentation should be:What was tried:
Setting
attr_value_brace_style = "AlwaysUnlessLit"
inleptosfmt.toml
but it doesn't seem to affect it (not sure if it's supposed to, it's not really documented on what they do)What happened:
What was expected: