From cb07b0466405f5e7437c78fafef240c4a5c0e1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= <454313500@qq.com> Date: Fri, 5 Jan 2024 10:17:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Managers/ArticleImport/VuePressArticleImport.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/Managers/ArticleImport/VuePressArticleImport.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/Managers/ArticleImport/VuePressArticleImport.cs index 48507e0b..526b01af 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/Managers/ArticleImport/VuePressArticleImport.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/Managers/ArticleImport/VuePressArticleImport.cs @@ -37,13 +37,13 @@ namespace Yi.Framework.Bbs.Domain.Managers.ArticleImport var startIndex = 0; for (int i = 0; i < lines.Length; i++) { - if (lines[i] == "---") + //编码问题 + if (lines[i] == "---" || lines[i]== "---") { num++; if (num == 2) { startIndex = i; - logger.LogError($"startIndex={startIndex}"); break; } @@ -52,10 +52,11 @@ namespace Yi.Framework.Bbs.Domain.Managers.ArticleImport } var linesRef = lines.ToList(); - linesRef.RemoveRange(0, startIndex + 1); - + if (startIndex != 0) + { + linesRef.RemoveRange(0, startIndex + 1); + } var result = string.Join(Environment.NewLine, linesRef); - logger.LogError($"新的值:{result}"); f.Content = result; return f; });