mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui: highlighter: support line-numbers
This commit is contained in:
1 file changed
+1
@@ -10,6 +10,7 @@ const highlighterPage = new AutoloadPage('highlighterPage', () => {
|
||||
const m = language.match(/language-([a-z0-9]+)(\|[\d,-]+)/);
|
||||
if (m?.[2]) {
|
||||
$(code).parent().attr('data-line', m[2].substring(1));
|
||||
if (language.includes('line-numbers')) $(code).parent().addClass('line-numbers');
|
||||
$(code).attr('class', `language-${m[1]}`);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user