mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
add code block line numbering option to
This commit is contained in:
@@ -3,14 +3,14 @@ import emoji from 'markdown-it-emoji'
|
||||
import math from '@rokt33r/markdown-it-math'
|
||||
import hljs from 'highlight.js'
|
||||
|
||||
var createGutter = function (str) {
|
||||
var lc = (str.match(/\n/g) || []).length;
|
||||
var lines = [];
|
||||
for (var i = 1; i <= lc; i++) {
|
||||
lines.push('<span>' + i + '</span>');
|
||||
function createGutter (str) {
|
||||
let lc = (str.match(/\n/g) || []).length
|
||||
let lines = []
|
||||
for (let i = 1; i <= lc; i++) {
|
||||
lines.push('<span>' + i + '</span>')
|
||||
}
|
||||
return '<span>' + lines.join('') + '</span>';
|
||||
};
|
||||
return '<span class="lineNumber">' + lines.join('') + '</span>'
|
||||
}
|
||||
|
||||
var md = markdownit({
|
||||
typographer: true,
|
||||
|
||||
Reference in New Issue
Block a user