mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-17 11:41:44 +00:00
followed eslintrc
This commit is contained in:
@@ -26,22 +26,22 @@ var md = markdownit({
|
|||||||
xhtmlOut: true,
|
xhtmlOut: true,
|
||||||
breaks: true,
|
breaks: true,
|
||||||
highlight: function (str, lang) {
|
highlight: function (str, lang) {
|
||||||
let delimiter = ":";
|
const delimiter = ':'
|
||||||
let langinfo = lang.split(delimiter);
|
const langInfo = lang.split(delimiter)
|
||||||
let lang = langinfo[0];
|
const langType = langInfo[0]
|
||||||
let filename = langinfo[1] || "";
|
const fileName = langInfo[1] || ''
|
||||||
let fc = parseInt(langinfo[2],10);
|
const fc = parseInt(langInfo[2], 10)
|
||||||
|
|
||||||
if (lang === 'flowchart') {
|
if (langType === 'flowchart') {
|
||||||
return `<pre class="flowchart">${str}</pre>`
|
return `<pre class="flowchart">${str}</pre>`
|
||||||
}
|
}
|
||||||
if (lang === 'sequence') {
|
if (langType === 'sequence') {
|
||||||
return `<pre class="sequence">${str}</pre>`
|
return `<pre class="sequence">${str}</pre>`
|
||||||
}
|
}
|
||||||
return '<pre class="code">' +
|
return '<pre class="code">' +
|
||||||
'<span class="filename">' + filename + '</span>' +
|
'<span class="filename">' + fileName + '</span>' +
|
||||||
createGutter(str, fc) +
|
createGutter(str, fc) +
|
||||||
'<code class="' + lang + '">' +
|
'<code class="' + langType + '">' +
|
||||||
str +
|
str +
|
||||||
'</code></pre>'
|
'</code></pre>'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user