mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Remove an unused function
This commit is contained in:
@@ -141,34 +141,6 @@ 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 strip (input) {
|
|
||||||
var output = input
|
|
||||||
try {
|
|
||||||
output = output
|
|
||||||
.replace(/^([\s\t]*)([\*\-\+]|\d\.)\s+/gm, '$1')
|
|
||||||
.replace(/\n={2,}/g, '\n')
|
|
||||||
.replace(/~~/g, '')
|
|
||||||
.replace(/`{3}.*\n/g, '')
|
|
||||||
.replace(/<(.*?)>/g, '$1')
|
|
||||||
.replace(/^[=\-]{2,}\s*$/g, '')
|
|
||||||
.replace(/\[\^.+?\](: .*?$)?/g, '')
|
|
||||||
.replace(/\s{0,2}\[.*?\]: .*?$/g, '')
|
|
||||||
.replace(/!\[.*?\][\[\(].*?[\]\)]/g, '')
|
|
||||||
.replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '$1')
|
|
||||||
.replace(/>/g, '')
|
|
||||||
.replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g, '')
|
|
||||||
.replace(/^#{1,6}\s*([^#]*)\s*(#{1,6})?/gm, '$1')
|
|
||||||
.replace(/(`{3,})(.*?)\1/gm, '$2')
|
|
||||||
.replace(/^-{3,}\s*$/g, '')
|
|
||||||
.replace(/`(.+?)`/g, '$1')
|
|
||||||
.replace(/\n{2,}/g, '\n\n')
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e)
|
|
||||||
return input
|
|
||||||
}
|
|
||||||
return output
|
|
||||||
}
|
|
||||||
|
|
||||||
function normalizeLinkText (linkText) {
|
function normalizeLinkText (linkText) {
|
||||||
return md.normalizeLinkText(linkText)
|
return md.normalizeLinkText(linkText)
|
||||||
}
|
}
|
||||||
@@ -179,10 +151,7 @@ const markdown = {
|
|||||||
const renderedContent = md.render(content)
|
const renderedContent = md.render(content)
|
||||||
return renderedContent
|
return renderedContent
|
||||||
},
|
},
|
||||||
strip,
|
|
||||||
normalizeLinkText
|
normalizeLinkText
|
||||||
return md.render(content)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default markdown
|
export default markdown
|
||||||
|
|||||||
Reference in New Issue
Block a user