Open DrSensor opened 1 year ago
Hey, I'm fairly certain this is a problem with the lambdasoup library. It eats attrs it doesn't recognize when it tries to pretty print. You can get around this by disabling pretty print in your soupault config. When I took your example and added
[settings]
...
pretty_print_html = false
It resulted in the following output:
<script src="//unpkg.com/alpinejs" defer=""></script>
<div x-data="{ count: 0 }">
<button click="count++">Increment</button>
<span x-text="count"></span>
</div>
<div x-data="{ placeholder: 'Type here...' }">
<input type="text" placeholder="placeholder">
</div>
So I am fairly certain this is really on the lambdasoup library and now on soupault.
Currently the parser (https://github.com/aantron/lambdasoup/issues/12) remove the namespace which break html page that use AlpineJS.
For example:
transformed into
However, the alternative syntax works fine, e.g
x-on:click
->@click
x-bind:placeholder
->:placeholder
Not AlpineJS related issues but it might cause trouble on other buildless js/html framework:
::
transformed into::=""
(not removed 👍)name:="value"
transformed into="value"
(malformed 👎)