Skip to content

Commit

Permalink
fix TestXWPFRun unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyqus committed Apr 16, 2024
1 parent 174fc67 commit 595ed45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion OpenXmlFormats/Wordprocessing/wml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2255,7 +2255,7 @@ public static CT_Text Parse(XmlNode node, XmlNamespaceManager namespaceManager)
internal void Write(StreamWriter sw, string nodeName)
{
sw.Write(string.Format("<w:{0}", nodeName));
if(valueField!=null&&(valueField.StartsWith(" ")||valueField.EndsWith(" ")))
if(valueField!=null&&(valueField.StartsWith(" ")||valueField.EndsWith(" ")||valueField.StartsWith("\t")||valueField.EndsWith("\t")))
{
this.space = "preserve";
XmlHelper.WriteAttribute(sw, "xml:space", this.space);
Expand Down
2 changes: 1 addition & 1 deletion ooxml/XWPF/Usermodel/XWPFRun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ public string GetStyle()
static void preserveSpaces(CT_Text xs)
{
String text = xs.Value;
if (text != null && text.Length>=1 && (text.StartsWith(" ") || text.EndsWith(" ")))
if (text != null && text.Length>=1 && (text.StartsWith(" ") || text.EndsWith(" ")||text.StartsWith("\t")||text.EndsWith("\t")))
{
// XmlCursor c = xs.NewCursor();
// c.ToNextToken();
Expand Down

0 comments on commit 595ed45

Please sign in to comment.