vugu / vugu

Vugu: A modern UI library for Go+WebAssembly (experimental)
https://www.vugu.org
MIT License
4.8k stars 175 forks source link

vugufmt applies ToLower on HTML if used recursively #192

Closed dbd closed 3 years ago

dbd commented 3 years ago

Describe the bug Running vugufmt -d components/my-line.vugu standard html diffs. Running vugufmt -d . will try to run ToLower on the same HTML.

Software Versions Vugu version: v0.3.4 Go version: 1.15.8 Browser and version: N/A

To Reproduce

# vugufmt -d components/my-line.vugu
# vugufmt -w components/my-line.vugu
# vugufmt -d .
diff -u root.vugu.orig root.vugu
--- root.vugu.orig      2021-04-03 10:25:17.110000000 -0500
+++ root.vugu   2021-04-03 10:25:17.110000000 -0500
@@ -1,7 +1,7 @@
 <div class="root">
-    <ul>
-      <components:MyLine FileName="example.txt" :LineNumber="rand.Int63n(100)" ></components:MyLine>
-    </ul>
+       <ul>
+               <components:myline filename="example.txt" :linenumber="rand.Int63n(100)" ></components:myline>
+       </ul>
 </div>

 <script type="application/x-go">

Expected behavior HTML is only formatted and converted to lower case.

Additional Notes example repo: https://github.com/dbd/vugu-fmt-bug

bradleypeabody commented 3 years ago

Thanks for the bug report. Yeah vugufmt needs some love, it hasn't been updated in a while. I'll leave this open for now.