mirror of
https://github.com/status-im/codimd.git
synced 2025-02-04 14:43:34 +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) {
|
||||
const filenames = {}
|
||||
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 suffix = 0
|
||||
do {
|
||||
|
@ -1061,26 +1061,26 @@ md.renderer.rules.fence = (tokens, idx, options, env, self) => {
|
||||
}
|
||||
|
||||
const makePlantumlURL = (umlCode) => {
|
||||
let format = 'svg'
|
||||
let code = plantumlEncoder.encode(umlCode)
|
||||
const format = 'svg'
|
||||
const code = plantumlEncoder.encode(umlCode)
|
||||
return `${plantumlServer}/${format}/${code}`
|
||||
}
|
||||
|
||||
// https://github.com/qjebbs/vscode-plantuml/tree/master/src/markdown-it-plantuml
|
||||
md.renderer.rules.plantuml = (tokens, idx) => {
|
||||
let token = tokens[idx]
|
||||
const token = tokens[idx]
|
||||
if (token.type !== 'plantuml') {
|
||||
return tokens[idx].content
|
||||
}
|
||||
|
||||
let url = makePlantumlURL(token.content)
|
||||
const url = makePlantumlURL(token.content)
|
||||
return `<img src="${url}" />`
|
||||
}
|
||||
|
||||
// https://github.com/qjebbs/vscode-plantuml/tree/master/src/markdown-it-plantuml
|
||||
md.core.ruler.push('plantuml', (state) => {
|
||||
let blockTokens = state.tokens
|
||||
for (let blockToken of blockTokens) {
|
||||
const blockTokens = state.tokens
|
||||
for (const blockToken of blockTokens) {
|
||||
if (blockToken.type === 'fence' && blockToken.info === 'plantuml') {
|
||||
blockToken.type = 'plantuml'
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user