File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments