Improve exporting markdown
This commit is contained in:
@@ -1527,7 +1527,7 @@ module.exports = function (options) {
|
||||
console.log("Done processing all...")
|
||||
}
|
||||
|
||||
response.redirect(`/project/${project.id}`)
|
||||
response.redirect(`/projects/${project.id}`)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
|
||||
@@ -368,11 +368,15 @@ module.exports = function (options) {
|
||||
response.contentType = "text/plain"
|
||||
response.send(tokens.reduce(
|
||||
(accumulator, token) => {
|
||||
if (token.type == "list_item_close" || token.type == "bullet_list_open") {
|
||||
if (token.type == "list_item_close") {
|
||||
return accumulator
|
||||
}
|
||||
|
||||
if (token.type == "bullet_list_close" ) {
|
||||
if (token.type == "ordered_list_open" || token.type == "bullet_list_open") {
|
||||
return accumulator
|
||||
}
|
||||
|
||||
if (token.type == "bullet_list_close" || token.type == "ordered_list_close") {
|
||||
return accumulator + "\n"
|
||||
}
|
||||
|
||||
@@ -386,12 +390,21 @@ module.exports = function (options) {
|
||||
}
|
||||
|
||||
if (token.type == "list_item_open") {
|
||||
return accumulator + "- "
|
||||
return accumulator + `${token.info}${token.markup} `
|
||||
}
|
||||
|
||||
if (token.type == "inline") {
|
||||
return accumulator + token.content
|
||||
}
|
||||
|
||||
if (token.type == "heading_open") {
|
||||
return `${accumulator}${token.markup} `
|
||||
}
|
||||
|
||||
if (token.type == "heading_close") {
|
||||
return `${accumulator}\n`
|
||||
}
|
||||
|
||||
return accumulator + token.markup
|
||||
},
|
||||
""
|
||||
|
||||
Reference in New Issue
Block a user