Skip to content

Commit 2835d9c

Browse files
authored
Fix possible empty quote (#213)
1 parent 834e451 commit 2835d9c

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules/
33
dist/
44
.prettier-cache
55
/book/book
6+
/leptos-fluent-macros/wip/

Cargo.lock

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

leptos-fluent-macros/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -728,9 +728,6 @@ pub fn leptos_fluent(
728728
for attr in html_tag_as_string.split(' ') {
729729
let mut parts = attr.split('=');
730730
let key = parts.next().unwrap_or("");
731-
if key.is_empty() {
732-
continue;
733-
}
734731
let value = parts.next().unwrap_or("");
735732
if key == "class" {
736733
class = Some(value.trim_matches('"').to_string().into());
@@ -759,7 +756,7 @@ pub fn leptos_fluent(
759756
};
760757

761758
match quote.is_empty() {
762-
true => quote! {},
759+
true => quote! { false },
763760
false => match param.exprpath {
764761
Some(ref path) => quote! { #path{#quote} },
765762
None => quote,
@@ -818,7 +815,7 @@ pub fn leptos_fluent(
818815
};
819816

820817
match quote.is_empty() {
821-
true => quote! {},
818+
true => quote! { false },
822819
false => match param.exprpath {
823820
Some(ref path) => quote! { #path{#quote} },
824821
None => quote,

0 commit comments

Comments
 (0)