Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions OpenXmlPowerTools/WmlToHtmlConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,16 @@ private static object ConvertToHtmlTransform(WordprocessingDocument wordDoc,
);
if (!a.Nodes().Any())
a.Add(new XText(""));

// Append anchor to the hyperlinks
if (element.Attribute(W.anchor) != null)
{
if (a.Attribute("href") != null && ProcessHyperlinkToBookmark(wordDoc, settings, element) is XElement a2)
{
string anchor = a2.Attribute("href")?.Value.Split('#')[1];
a.Attribute("href").Value += "#" + anchor;
}
}
return a;
}
catch (UriFormatException)
Expand Down