mirror of
https://github.com/caddyserver/website.git
synced 2025-04-24 14:06:17 -04:00
Use window.$ to make VSCode syntax highlighting play nice
This commit is contained in:
parent
2639f28a27
commit
f10b1e85f1
8 changed files with 24 additions and 24 deletions
|
@ -3,19 +3,19 @@ title: reverse_proxy (Caddyfile directive)
|
|||
---
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
window.$(function() {
|
||||
// Fix response matchers to render with the right color,
|
||||
// and link to response matchers section
|
||||
$('pre.chroma .k:contains("@")')
|
||||
window.$('pre.chroma .k:contains("@")')
|
||||
.map(function(k, item) {
|
||||
let text = item.innerText.replace(/</g,'<').replace(/>/g,'>');
|
||||
let url = '#' + item.innerText.replace(/_/g, "-");
|
||||
$(item).addClass('nd').removeClass('k')
|
||||
$(item).html('<a href="#response-matcher" style="color: inherit;" title="Response matcher">' + text + '</a>');
|
||||
window.$(item).addClass('nd').removeClass('k')
|
||||
window.$(item).html(`<a href="#response-matcher" style="color: inherit;" title="Response matcher">${text}</a>`);
|
||||
});
|
||||
|
||||
// Fix matcher placeholder
|
||||
$('pre.chroma .k:contains("handle_response")').first().nextAll().slice(0, 3)
|
||||
window.$('pre.chroma .k:contains("handle_response")').first().nextAll().slice(0, 3)
|
||||
.wrapAll('<span class="nd">').parent()
|
||||
.html('<a href="#response-matcher" style="color: inherit;" title="Response matcher">[<matcher>]</a>')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue