Open DrSensor opened 1 year ago
This has been in my mind and I think I will settle on this idea.
Make the attribute-prefix configurable!
<script type=attrprefix>{
"propAttr": "this.",
"justAttr": "attr:",
"toggleAttr": "!",
"listener": "on:",
"builtin": "#",
"marker": "~",
"bakedin": "-"
}</script>
Alternatively use inbuilt prefixset
<script src="//esm.run/nusa/prefixset/laravel-blade" async></script>
<script src="//esm.run/nusa" defer></script>
Templating
✅ HTML ✅ XHTML ❌ JSX (JavaScript) ❌ templ (Go) [^templ] ❔ Laravel Blade (PHP) ✅ Django (Python) ✅ ERB (Ruby) ✅
html/template
(Hugo|Go) [^html/template] ❌ WebC (11ty|JavaScript) ✅ Tera (Zola|Rust) ✅ Eta / EJS (JavaScript) ✅ Liquid ✅ Jinja / Nunjucks / ... ✅ Svelte (JavaScript) ❌ Vue (JavaScript) ❔ Astro (JavaScript) ❔ Angular (JavaScript)Processor
✅ Lambda Soup (Soupault|OCaml) ❔ parse5 (JavaScript) ✅ lxml (Python) ❔ lol-html (Rust, HTMLRewriter|JavaScript)
Workaround
html/template
: most likely work on native mode but it's best to use namespace mode [^1][^html/template]: Go standard html templating sanitize attribute value except attribute name with namespace or data- prefix. The sanitizer may break the micro-syntax. For example,
.value="prop.count~>my.count"
may transform into.value="prop.count~>my.count"
🤔[^templ]: Currently templ only support attr with prefix
@
_
:
a-z
(source). Looking at their git history, seems they open for changes 🤔