Syntax highlight on-demand example, fix rollover

This commit is contained in:
Francis Lavoie 2023-11-22 05:51:58 -05:00
parent 7cba863d53
commit 4610d84904
No known key found for this signature in database
GPG key ID: 0F66EE1687682239
4 changed files with 40 additions and 27 deletions

View file

@ -0,0 +1,36 @@
<script>
ready(() => {
let startElement, endElement;
startElement = findWithContent('.ex-on-demand pre.chroma code span.line', 'on_demand_tls {');
endElement = findNextText(startElement, '}');
wrapRangeWithSpan(startElement, endElement, 'rollover-abuse rollover-purple');
startElement = findWithContent('.ex-on-demand pre.chroma code span.line', 'tls');
endElement = findNextText(startElement, '}');
wrapRangeWithSpan(startElement, endElement, 'rollover-ondemand rollover-green');
window.$_('.ex-on-demand code').classList.add('light');
});
</script>
<div class="ex-on-demand">
```caddy
{
on_demand_tls {
ask http://localhost:9123/check
}
}
https:// {
tls {
on_demand
}
# reverse_proxy, etc...
}
# other sites...
```
</div>