mirror of
https://github.com/status-im/codimd.git
synced 2025-02-09 22:24:12 +00:00
refactor: fix line after merged develop
Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
parent
1ebf9ca374
commit
ff124ab6bf
@ -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 {
|
||||||
|
@ -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'
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user