Spaces:
Sleeping
Sleeping
Fix /mirror subtab clicks (HTML-escaped < in highlightCode regex broke entire script) (#9)
Browse files- Mirror: unbreak subtab clicks (regex had HTML-escaped < in highlightCode) (c8408328010b9326e86c30c11371f33df908974a)
- mirror.html +1 -1
mirror.html
CHANGED
|
@@ -594,7 +594,7 @@ function highlightCode(code) {
|
|
| 594 |
.replace(/\b(def|class|if|elif|else|for|while|return|import|from|as|with|try|except|raise|lambda|in|not|and|or|is|None|True|False)\b/g,
|
| 595 |
'<span class="k">$1</span>')
|
| 596 |
.replace(/("[^&]*?")/g, '<span class="s">$1</span>')
|
| 597 |
-
.replace(/(?
|
| 598 |
}
|
| 599 |
|
| 600 |
function divergenceUpdate(userV, userA) {
|
|
|
|
| 594 |
.replace(/\b(def|class|if|elif|else|for|while|return|import|from|as|with|try|except|raise|lambda|in|not|and|or|is|None|True|False)\b/g,
|
| 595 |
'<span class="k">$1</span>')
|
| 596 |
.replace(/("[^&]*?")/g, '<span class="s">$1</span>')
|
| 597 |
+
.replace(/(?<![a-zA-Z_])(\d+)\b/g, '<span class="n">$1</span>');
|
| 598 |
}
|
| 599 |
|
| 600 |
function divergenceUpdate(userV, userA) {
|