refactor: fix line after merged develop

Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
BoHong Li 2019-08-04 23:52:06 +08:00
parent 1ebf9ca374
commit ff124ab6bf
No known key found for this signature in database
GPG Key ID: 06770355DC9ECD38
2 changed files with 7 additions and 7 deletions

View File

@ -91,7 +91,7 @@ UserRouter.get('/me/export', function (req, res) {
}).then(function (notes) { }).then(function (notes) {
const filenames = {} const filenames = {}
async.each(notes, function (note, callback) { async.each(notes, function (note, callback) {
let basename = note.title.replace(/\//g, '-') // Prevent subdirectories const basename = note.title.replace(/\//g, '-') // Prevent subdirectories
let filename let filename
let suffix = 0 let suffix = 0
do { do {

View File

@ -1061,26 +1061,26 @@ md.renderer.rules.fence = (tokens, idx, options, env, self) => {
} }
const makePlantumlURL = (umlCode) => { const makePlantumlURL = (umlCode) => {
let format = 'svg' const format = 'svg'
let code = plantumlEncoder.encode(umlCode) const code = plantumlEncoder.encode(umlCode)
return `${plantumlServer}/${format}/${code}` return `${plantumlServer}/${format}/${code}`
} }
// https://github.com/qjebbs/vscode-plantuml/tree/master/src/markdown-it-plantuml // https://github.com/qjebbs/vscode-plantuml/tree/master/src/markdown-it-plantuml
md.renderer.rules.plantuml = (tokens, idx) => { md.renderer.rules.plantuml = (tokens, idx) => {
let token = tokens[idx] const token = tokens[idx]
if (token.type !== 'plantuml') { if (token.type !== 'plantuml') {
return tokens[idx].content return tokens[idx].content
} }
let url = makePlantumlURL(token.content) const url = makePlantumlURL(token.content)
return `<img src="${url}" />` return `<img src="${url}" />`
} }
// https://github.com/qjebbs/vscode-plantuml/tree/master/src/markdown-it-plantuml // https://github.com/qjebbs/vscode-plantuml/tree/master/src/markdown-it-plantuml
md.core.ruler.push('plantuml', (state) => { md.core.ruler.push('plantuml', (state) => {
let blockTokens = state.tokens const blockTokens = state.tokens
for (let blockToken of blockTokens) { for (const blockToken of blockTokens) {
if (blockToken.type === 'fence' && blockToken.info === 'plantuml') { if (blockToken.type === 'fence' && blockToken.info === 'plantuml') {
blockToken.type = 'plantuml' blockToken.type = 'plantuml'
} }