From 640845d514ad3ebd53c939009874d3b76889fee2 Mon Sep 17 00:00:00 2001 From: Hiep Le Date: Wed, 16 Oct 2024 15:43:20 +0700 Subject: [PATCH] Update MiniWord.Implment.cs Fix when a Split Tag Text element Inner Text start with " {" instead of "{" --- src/MiniWord/MiniWord.Implment.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MiniWord/MiniWord.Implment.cs b/src/MiniWord/MiniWord.Implment.cs index a1085ab..d4b461a 100644 --- a/src/MiniWord/MiniWord.Implment.cs +++ b/src/MiniWord/MiniWord.Implment.cs @@ -236,7 +236,7 @@ private static void AvoidSplitTagText(OpenXmlElement xmlElement) foreach (var text in texts) { var clear = false; - if (text.InnerText.StartsWith("{")) + if (text.InnerText.TrimStart().StartsWith("{")) { needAppend = true; } @@ -245,7 +245,7 @@ private static void AvoidSplitTagText(OpenXmlElement xmlElement) sb.Append(text.InnerText); pool.Add(text); - var s = sb.ToString(); //TODO: + var s = sb.ToString().TrimStart(); //TODO: // TODO: check tag exist // TODO: record tag text if without tag then system need to clear them // TODO: every {{tag}} one for them and add text before first text and copy first one and remove {{, tagname, }}