Skip to content

Commit

Permalink
Fix duplicate source HTML during translation
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelDomingues committed Oct 31, 2023
1 parent f072d14 commit 985e808
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ protected override void Write(TransformRenderer renderer, HtmlBlock obj)
html = UpdateImageRelativePaths(renderer.Options.ImageRelativePath, html);

if (renderer.Options.KeepHTMLTagsTogetherEnabled())
ProcessHTMLTogether(renderer, doc.Body, html, obj.Span.Start);
{
if (doc.Body.Descendants<IText>().Count() > 0)
ProcessHTMLTogether(renderer, doc.Body, html, obj.Span.Start);
else
renderer.Write(html);
}
else
ProcessHTMLIndependent(renderer, doc, html, obj.Span.Start);
}
Expand Down Expand Up @@ -96,10 +101,7 @@ private void ProcessHTMLTogether(TransformRenderer renderer, INode parent, strin
}
else
{
if (text != "")
renderer.Write(nodeHtml.OuterHtml);
else
renderer.Write(html);
renderer.Write(nodeHtml.OuterHtml);
}
}
renderer.PopElementType();
Expand Down

0 comments on commit 985e808

Please sign in to comment.