mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
forgot to run eslint (again)
This commit is contained in:
@@ -8,7 +8,7 @@ import ConfigManager from 'browser/main/lib/ConfigManager'
|
|||||||
const katex = window.katex
|
const katex = window.katex
|
||||||
const config = ConfigManager.get()
|
const config = ConfigManager.get()
|
||||||
|
|
||||||
function createGutter(str) {
|
function createGutter (str) {
|
||||||
const lc = (str.match(/\n/g) || []).length
|
const lc = (str.match(/\n/g) || []).length
|
||||||
const lines = []
|
const lines = []
|
||||||
for (let i = 1; i <= lc; i++) {
|
for (let i = 1; i <= lc; i++) {
|
||||||
@@ -76,14 +76,14 @@ md.use(require('markdown-it-named-headers'), {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
md.use(require('markdown-it-kbd'))
|
md.use(require('markdown-it-kbd'))
|
||||||
md.use(require("markdown-it-plantuml"), "", {
|
md.use(require('markdown-it-plantuml'), '', {
|
||||||
generateSource: function (umlCode) {
|
generateSource: function (umlCode) {
|
||||||
var deflate = require("markdown-it-plantuml/lib/deflate")
|
var deflate = require('markdown-it-plantuml/lib/deflate')
|
||||||
var s = unescape(encodeURIComponent(umlCode))
|
var s = unescape(encodeURIComponent(umlCode))
|
||||||
var zippedCode = deflate.encode64(
|
var zippedCode = deflate.encode64(
|
||||||
deflate.zip_deflate("@startuml\n" + s + "\n@enduml", 9)
|
deflate.zip_deflate(`@startuml\n${s}\n@enduml`, 9)
|
||||||
);
|
)
|
||||||
return "http://www.plantuml.com/plantuml/svg/" + zippedCode
|
return `http://www.plantuml.com/plantuml/svg/${zippedCode}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) {
|
|||||||
|
|
||||||
// Add line number attribute for scrolling
|
// Add line number attribute for scrolling
|
||||||
const originalRender = md.renderer.render
|
const originalRender = md.renderer.render
|
||||||
md.renderer.render = function render(tokens, options, env) {
|
md.renderer.render = function render (tokens, options, env) {
|
||||||
tokens.forEach((token) => {
|
tokens.forEach((token) => {
|
||||||
switch (token.type) {
|
switch (token.type) {
|
||||||
case 'heading_open':
|
case 'heading_open':
|
||||||
@@ -156,12 +156,12 @@ md.renderer.render = function render(tokens, options, env) {
|
|||||||
// FIXME We should not depend on global variable.
|
// FIXME We should not depend on global variable.
|
||||||
window.md = md
|
window.md = md
|
||||||
|
|
||||||
function normalizeLinkText(linkText) {
|
function normalizeLinkText (linkText) {
|
||||||
return md.normalizeLinkText(linkText)
|
return md.normalizeLinkText(linkText)
|
||||||
}
|
}
|
||||||
|
|
||||||
const markdown = {
|
const markdown = {
|
||||||
render: function markdown(content) {
|
render: function markdown (content) {
|
||||||
if (!_.isString(content)) content = ''
|
if (!_.isString(content)) content = ''
|
||||||
const renderedContent = md.render(content)
|
const renderedContent = md.render(content)
|
||||||
return renderedContent
|
return renderedContent
|
||||||
|
|||||||
Reference in New Issue
Block a user