Files
Brian Carbone 99921ffc39 runtime(marko): improve syntax highlighting
closes: #20874

Signed-off-by: Brian Carbone <brian@briancarbone.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-07-30 18:32:16 +00:00

49 lines
1.4 KiB
Plaintext

<!doctype html>
<!-- html mode: tags, attributes, embedded languages -->
import { formatPrice } from "./util"
static const VERSION = 1
<style/styles>
.price { color: green }
</style>
<let/count=1/>
<const/[width, , ...dims]=box/>
<div.card#main class="cart" total:=sum ...rest ...(a ? b : c)>
<if=tag === "select" || count > 0>
<my-button size="lg" onClick=(e) => buy(e)>${count + 1}</my-button>
</if>
<else-if=fallback ?? choices/>
<for|item, index| of=items>
<span>${formatPrice(item.price)}</span>
</for>
<generic-list<Config<string>> a=1/>
<${dynamicTag} title="dynamic">body</${dynamicTag}>
</div>
<link
rel="canonical"
href=translated
? localizeUrl(url, { locale }).href
: baseHref
>
<audio-player ratio=total / count volume=Math.max(
0,
settings.findIndex((s) => s.active),
)/>
<h${size} id:scoped>heading</>
<${"hello"}-world/>
<badge#item-${id}.tone-${kind} café="façade" x=`a${`b ${c}`}d`/>
<form onSubmit<T>(e) { go<T>(e) } action(a, b) msg="say \"hi\""/>
<effect() { cleanup() }>body prose</effect>
<await(promise)>
<@then|result|>${result}</@then>
</await>
<macro renderPrice|amount|>${formatPrice(amount)}</macro>
<div
class="multiline"
data-x=1
>text with &amp; entity and \${an escaped placeholder}</div>
<textarea rows=3>literal <b>text</b> with ${count}</textarea>
<script>
const el = document.querySelector(".price");
</script>