mirror of
https://github.com/status-im/codimd.git
synced 2025-01-15 20:06:16 +00:00
refactor: fix lint on public/js/extra.js
Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
parent
be527765bd
commit
8ca8484992
@ -350,7 +350,7 @@ export function finishView (view) {
|
|||||||
$value.html('')
|
$value.html('')
|
||||||
chart.drawSVG(value, {
|
chart.drawSVG(value, {
|
||||||
'line-width': 2,
|
'line-width': 2,
|
||||||
'fill': 'none',
|
fill: 'none',
|
||||||
'font-size': '16px',
|
'font-size': '16px',
|
||||||
'font-family': "'Andale Mono', monospace"
|
'font-family': "'Andale Mono', monospace"
|
||||||
})
|
})
|
||||||
@ -747,12 +747,12 @@ export function generateToc (id) {
|
|||||||
target.html('')
|
target.html('')
|
||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
var toc = new window.Toc('doc', {
|
var toc = new window.Toc('doc', {
|
||||||
'level': 3,
|
level: 3,
|
||||||
'top': -1,
|
top: -1,
|
||||||
'class': 'toc',
|
class: 'toc',
|
||||||
'ulClass': 'nav',
|
ulClass: 'nav',
|
||||||
'targetId': id,
|
targetId: id,
|
||||||
'process': getHeaderContent
|
process: getHeaderContent
|
||||||
})
|
})
|
||||||
/* eslint-enable no-unused-vars */
|
/* eslint-enable no-unused-vars */
|
||||||
if (target.text() === 'undefined') { target.html('') }
|
if (target.text() === 'undefined') { target.html('') }
|
||||||
@ -835,7 +835,7 @@ const linkifyAnchors = (level, containingElement) => {
|
|||||||
const headers = containingElement.getElementsByTagName(`h${level}`)
|
const headers = containingElement.getElementsByTagName(`h${level}`)
|
||||||
|
|
||||||
for (let i = 0, l = headers.length; i < l; i++) {
|
for (let i = 0, l = headers.length; i < l; i++) {
|
||||||
let header = headers[i]
|
const header = headers[i]
|
||||||
if (header.getElementsByClassName('anchor').length === 0) {
|
if (header.getElementsByClassName('anchor').length === 0) {
|
||||||
if (typeof header.id === 'undefined' || header.id === '') {
|
if (typeof header.id === 'undefined' || header.id === '') {
|
||||||
// to escape characters not allow in css and humanize
|
// to escape characters not allow in css and humanize
|
||||||
@ -894,12 +894,12 @@ export function renderTOC (view) {
|
|||||||
const target = $(`#${id}`)
|
const target = $(`#${id}`)
|
||||||
target.html('')
|
target.html('')
|
||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
let TOC = new window.Toc('doc', {
|
const TOC = new window.Toc('doc', {
|
||||||
'level': 3,
|
level: 3,
|
||||||
'top': -1,
|
top: -1,
|
||||||
'class': 'toc',
|
class: 'toc',
|
||||||
'targetId': id,
|
targetId: id,
|
||||||
'process': getHeaderContent
|
process: getHeaderContent
|
||||||
})
|
})
|
||||||
/* eslint-enable no-unused-vars */
|
/* eslint-enable no-unused-vars */
|
||||||
if (target.text() === 'undefined') { target.html('') }
|
if (target.text() === 'undefined') { target.html('') }
|
||||||
@ -947,7 +947,7 @@ function highlightRender (code, lang) {
|
|||||||
return result.value
|
return result.value
|
||||||
}
|
}
|
||||||
|
|
||||||
export let md = markdownit('default', {
|
export const md = markdownit('default', {
|
||||||
html: true,
|
html: true,
|
||||||
breaks: true,
|
breaks: true,
|
||||||
langPrefix: '',
|
langPrefix: '',
|
||||||
@ -1016,7 +1016,7 @@ md.use(markdownitContainer, 'spoiler', {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
let defaultImageRender = md.renderer.rules.image
|
const defaultImageRender = md.renderer.rules.image
|
||||||
md.renderer.rules.image = function (tokens, idx, options, env, self) {
|
md.renderer.rules.image = function (tokens, idx, options, env, self) {
|
||||||
tokens[idx].attrJoin('class', 'raw')
|
tokens[idx].attrJoin('class', 'raw')
|
||||||
return defaultImageRender(...arguments)
|
return defaultImageRender(...arguments)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user