You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
For two consecutive spans there is an additional space inserted between them.
Expected behavior
Just the content of the two spans without the space.
Repro <span>foo</span><span>bar</span>
In the browser:
In the docx:
In this example a single paragraph is generated that contains 3 runs. One run for each of the spans and one for the additional space.
Sample test for easier repro:
public class HtmlToOpenXmlTests
{
[Fact]
public void TwoSpans()
{
using var memoryStream = new MemoryStream();
using var wordDocument = WordprocessingDocument.Create(memoryStream, DocumentFormat.OpenXml.WordprocessingDocumentType.Document, true);
var mainPart = wordDocument.AddMainDocumentPart();
mainPart.Document = new Document();
mainPart.Document.AppendChild(new Body());
var htmlConverter = new HtmlConverter(mainPart);
var html = "<p><span>foo</span><span>bar</span></p>";
var parsedElements = htmlConverter.Parse(html);
var text = ((Paragraph)parsedElements[0]).InnerText;
text.Should().Be("foobar"); // text is "foo bar" instead
}
}
The text was updated successfully, but these errors were encountered:
Describe the bug
For two consecutive spans there is an additional space inserted between them.
Expected behavior
Just the content of the two spans without the space.
Repro
<span>foo</span><span>bar</span>
In the browser:
In the docx:
In this example a single paragraph is generated that contains 3 runs. One run for each of the spans and one for the additional space.
Sample test for easier repro:
The text was updated successfully, but these errors were encountered: