diff --git a/xuan-deduct-uniapp/src/utils/markdownToHtml.js b/xuan-deduct-uniapp/src/utils/markdownToHtml.js index 9a7815c..b6c7619 100644 --- a/xuan-deduct-uniapp/src/utils/markdownToHtml.js +++ b/xuan-deduct-uniapp/src/utils/markdownToHtml.js @@ -6,7 +6,7 @@ export function markdownToHtml(markdown) { const lines = html.split('\n') if (lines.length > 0) { lines.shift() - html = lines.join('\n').trim() + html = lines.map(line => line.trimStart()).join('\n').trim() } html = html.replace(/^### (.*$)/gim, '
$1')
- html = html.replace(/^\s*[-•]\s(.+)$/gim, '') + html = html.replace(/\n\n/g, '
')
html = html.replace(/\n/g, '
')
if (!html.startsWith('<')) {
- html = '
' + html + '
' + html = '' + html + '
' } return html