fix: some edge cases around autoformatting (#485)

* wip: remove comment support from autofmt

* fix: some edge cases around autoformatting

* fix: revert readme

* fix: failing test
This commit is contained in:
Jon Kelley authored and GitHub committed 2022-07-04 21:11:03 -04:00
1 parent 3a5d1a2ff8
commit 3a30b36f68
11 files changed
+536 -141

No files matched your search

-16
View File
@@ -1,19 +1,3 @@
use dioxus_rsx::*;
// todo: use recursive or complete sizeing
pub fn extract_attr_len(attributes: &[ElementAttrNamed]) -> usize {
attributes
.iter()
.map(|attr| match &attr.attr {
ElementAttr::AttrText { value, .. } => value.value().len(),
ElementAttr::AttrExpression { .. } => 10,
ElementAttr::CustomAttrText { value, .. } => value.value().len(),
ElementAttr::CustomAttrExpression { .. } => 10,
ElementAttr::EventTokens { .. } => 1000000,
})
.sum()
}
pub fn find_bracket_end(contents: &str) -> Option<usize> {
let mut depth = 0;