refactor: fix lint on public/js/extra.js

Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
BoHong Li 2019-08-02 01:02:55 +08:00
parent be527765bd
commit 8ca8484992
No known key found for this signature in database
GPG Key ID: 06770355DC9ECD38
1 changed files with 16 additions and 16 deletions

View File

@ -350,7 +350,7 @@ export function finishView (view) {
$value.html('')
chart.drawSVG(value, {
'line-width': 2,
'fill': 'none',
fill: 'none',
'font-size': '16px',
'font-family': "'Andale Mono', monospace"
})
@ -747,12 +747,12 @@ export function generateToc (id) {
target.html('')
/* eslint-disable no-unused-vars */
var toc = new window.Toc('doc', {
'level': 3,
'top': -1,
'class': 'toc',
'ulClass': 'nav',
'targetId': id,
'process': getHeaderContent
level: 3,
top: -1,
class: 'toc',
ulClass: 'nav',
targetId: id,
process: getHeaderContent
})
/* eslint-enable no-unused-vars */
if (target.text() === 'undefined') { target.html('') }
@ -835,7 +835,7 @@ const linkifyAnchors = (level, containingElement) => {
const headers = containingElement.getElementsByTagName(`h${level}`)
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 (typeof header.id === 'undefined' || header.id === '') {
// to escape characters not allow in css and humanize
@ -894,12 +894,12 @@ export function renderTOC (view) {
const target = $(`#${id}`)
target.html('')
/* eslint-disable no-unused-vars */
let TOC = new window.Toc('doc', {
'level': 3,
'top': -1,
'class': 'toc',
'targetId': id,
'process': getHeaderContent
const TOC = new window.Toc('doc', {
level: 3,
top: -1,
class: 'toc',
targetId: id,
process: getHeaderContent
})
/* eslint-enable no-unused-vars */
if (target.text() === 'undefined') { target.html('') }
@ -947,7 +947,7 @@ function highlightRender (code, lang) {
return result.value
}
export let md = markdownit('default', {
export const md = markdownit('default', {
html: true,
breaks: true,
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) {
tokens[idx].attrJoin('class', 'raw')
return defaultImageRender(...arguments)