Skip to content

Commit

Permalink
Merge pull request #68 from ping9719/main
Browse files Browse the repository at this point in the history
适配新OpenXml,解决换行为多行的问题
  • Loading branch information
shps951023 authored Feb 19, 2024
2 parents 14a7195 + 27af02a commit 57396af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/MiniWord/MiniWord.Implment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -473,16 +473,16 @@ private static void ReplaceText(OpenXmlElement xmlElement, WordprocessingDocumen
}
}
}

t.Text = EvaluateIfStatement(t.Text);

// add breakline
{
var newText = t.Text;
var splits = Regex.Split(newText, "(<[a-zA-Z/].*?>|\n)");
var splits = Regex.Split(newText, "(<[a-zA-Z/].*?>|\n|\r\n)").Where(o => o != "\n" && o != "\r\n");
var currentT = t;
var isFirst = true;
if (splits.Length > 1)
if (splits.Count() > 1)
{
foreach (var v in splits)
{
Expand Down
4 changes: 2 additions & 2 deletions src/MiniWord/MiniWord.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0;net5.0</TargetFrameworks>
<TargetFrameworks>net45;netstandard2.0;</TargetFrameworks>
<Version>0.7.1</Version>
</PropertyGroup>
<PropertyGroup>
Expand Down Expand Up @@ -32,6 +32,6 @@
<None Include="icon.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="2.18.0" />
<PackageReference Include="DocumentFormat.OpenXml" Version="3.0.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/MiniWord/MiniWordPicture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public string Extension
}
set { _extension = value; }
}
internal ImagePartType GetImagePartType
internal PartTypeInfo GetImagePartType
{
get
{
Expand Down

0 comments on commit 57396af

Please sign in to comment.