diff --git a/xuan-deduct-uniapp/src/utils/markdownToHtml.js b/xuan-deduct-uniapp/src/utils/markdownToHtml.js index be7b1fe..9a7815c 100644 --- a/xuan-deduct-uniapp/src/utils/markdownToHtml.js +++ b/xuan-deduct-uniapp/src/utils/markdownToHtml.js @@ -13,11 +13,16 @@ export function markdownToHtml(markdown) { html = html.replace(/^## (.*$)/gim, '

$1

') html = html.replace(/^# (.*$)/gim, '

$1

') + html = html.replace(/\*\*\*(.+?)\*\*\*/g, '$1') html = html.replace(/\*\*(.+?)\*\*/g, '$1') html = html.replace(/\*(.+?)\*/g, '$1') + html = html.replace(/__(.+?)__/g, '$1') + html = html.replace(/_(.+?)_/g, '$1') html = html.replace(/`(.+?)`/g, '$1') html = html.replace(/^\s*[-•]\s(.+)$/gim, '
  • $1
  • ') + html = html.replace(/^\s*\*\s(.+)$/gim, '
  • $1
  • ') + html = html.replace(/^\s*\+\s(.+)$/gim, '
  • $1
  • ') html = html.replace(/(]*>.*<\/li>\n?)+/g, function(match) { return ''