Skip to content

Commit 3009a79

Browse files
committed
nav.js: remove code-cm-wrap path, all pages use .syntax-block
1 parent de001e4 commit 3009a79

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

assets/nav.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,7 @@
132132
marker.id = 'ref-cm-loaded';
133133
document.head.appendChild(marker);
134134
const dark = document.body.classList.contains('dark-mode');
135-
// Example pages: render into #code-cm-wrap
136-
const cmWrap = document.getElementById('code-cm-wrap');
137-
const codePre = document.getElementById('code-pre');
138-
if (cmWrap && codePre) {
139-
const code = codePre.textContent.trim();
140-
const cm = CodeMirror(cmWrap, {
141-
value: '',
142-
mode: 'cppmode',
143-
theme: dark ? 'cppmode-dark' : 'cppmode',
144-
readOnly: true,
145-
lineNumbers: true,
146-
lineWrapping: false,
147-
});
148-
// Set value after init so CPPMODE_KEYWORDS is definitely loaded
149-
setTimeout(() => { cm.setValue(code); cm.refresh(); }, 0);
150-
}
151-
// Reference pages: replace .syntax-block and .impl-block
135+
// Reference and example pages: replace .syntax-block and .impl-block
152136
document.querySelectorAll('.syntax-block, .impl-block').forEach(el => {
153137
if (!el.parentNode) return;
154138
const code = el.innerHTML

0 commit comments

Comments
 (0)