File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 110110 marker . id = 'ref-cm-loaded' ;
111111 document . head . appendChild ( marker ) ;
112112 const dark = document . body . classList . contains ( 'dark-mode' ) ;
113- document . querySelectorAll ( '.syntax-block, .impl-block' ) . forEach ( el => {
113+ document . querySelectorAll ( '.syntax-block, .impl-block, .example-code, .code-example ' ) . forEach ( el => {
114114 const code = el . innerHTML
115115 . replace ( / & l t ; / g, '<' ) . replace ( / & g t ; / g, '>' ) . replace ( / & a m p ; / g, '&' ) . trim ( ) ;
116116 const wrap = document . createElement ( 'div' ) ;
117117 el . parentNode . replaceChild ( wrap , el ) ;
118- CodeMirror ( wrap , {
118+ const cm = CodeMirror ( wrap , {
119119 value : code ,
120120 mode : 'cppmode' ,
121121 theme : dark ? 'cppmode-dark' : 'cppmode' ,
122122 readOnly : true ,
123123 lineNumbers : false ,
124+ lineWrapping : false ,
124125 } ) ;
126+ wrap . style . overflow = 'auto' ;
127+ wrap . querySelector ( '.CodeMirror' ) . style . height = 'auto' ;
125128 } ) ;
126129 } ) ;
127130 } ) ;
You can’t perform that action at this time.
0 commit comments