16,874
个编辑
LLWiki正在建设中,欢迎加入我们!
标签:撤销 |
小 |
||
var lines = $this.html().replace(/\n$/, '').split('\n');
if (mw.config.get( 'wgNamespaceNumber' ) == 274) { lines = lines.slice(1, -1); } // 扔掉首尾的Wikitext注释
return $('<ol>', {
html: lines.
}).css('padding-left', lines.length.toString().length + 2.5 + 'ch');
});
mw.hook( 'code.prettify' ).fire( $block );
const fragment = decodeURIComponent( location.hash.slice(1) ),
target = document.getElementById( fragment ); // 用户输入内容,禁止使用$()
console.info( target );
console.info( $block.html().slice(0, 200) );
if (/^L\d+$/.test( fragment ) && target) { target.scrollIntoView({ behavior: 'smooth' }); }
}, function(reason) { mw.apiFailure(reason, 'highlight.js'); });
|