dev_forum
hjm 5 years ago
parent 2d2d92e022
commit 51e215f425

@ -6,6 +6,9 @@ export function isImageExtension(fileName) {
export function markdownToHTML(oldContent, selector) { export function markdownToHTML(oldContent, selector) {
window.$('#md_div').html('') window.$('#md_div').html('')
// markdown to html // markdown to html
if (selector && oldContent && oldContent.startsWith('<p>')) { // 普通html处理
window.$(selector).html(oldContent)
} else {
try { try {
var markdwonParser = window.editormd.markdownToHTML("md_div", { var markdwonParser = window.editormd.markdownToHTML("md_div", {
markdown: oldContent, // .replace(/▁/g,"▁▁▁"), markdown: oldContent, // .replace(/▁/g,"▁▁▁"),
@ -27,6 +30,7 @@ export function markdownToHTML(oldContent, selector) {
} }
return content return content
} }
}
export function appendFileSizeToUploadFile(item) { export function appendFileSizeToUploadFile(item) {
return `${item.title}${uploadNameSizeSeperator}${item.filesize}` return `${item.title}${uploadNameSizeSeperator}${item.filesize}`

Loading…
Cancel
Save