From 2592f502b411e01da99af337c6d8de062d260044 Mon Sep 17 00:00:00 2001 From: yulixing Date: Thu, 31 Oct 2019 10:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E7=9B=98=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/open/zp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/open/zp.js b/src/controllers/open/zp.js index ad2e4b8..4f4af47 100644 --- a/src/controllers/open/zp.js +++ b/src/controllers/open/zp.js @@ -76,7 +76,7 @@ router.get('/text', async (req, res, next) => { function parseText(text) { const result = [] const textArr = text.split('\n') - const textReg = /^(#+) (.*)::(.*)$/ + const textReg = /^(#+) (.*)(::)*(.*)$/ let lastLevel = 0 let lastIdx = 0 const posArr = [result] @@ -87,7 +87,7 @@ function parseText(text) { const curLevel = execRes[1].split('').length - 2 if (curLevel < 0) return const text = execRes[2] - const content = execRes[3] + const content = execRes[4] if (curLevel === lastLevel) { const curPos = posArr[curLevel] curPos.push({