public ConvertToHtmlNode ( string language ) : HtmlAgilityPack.HtmlNode | ||
language | string | |
return | HtmlAgilityPack.HtmlNode |
private (bool resolved, bool warn) UpdateXref(HtmlNode node, IDocumentBuildContext context, string language, out XRefDetails xref) { xref = XRefDetails.From(node); XRefSpec xrefSpec = null; if (!string.IsNullOrEmpty(xref.Uid)) { // Resolve external xref map first, and then internal xref map. // Internal one overrides external one xrefSpec = context.GetXrefSpec(HttpUtility.HtmlDecode(xref.Uid)); xref.ApplyXrefSpec(xrefSpec); } var renderer = xref.TemplatePath == null ? null : _rendererLoader.Load(xref.TemplatePath); var(convertedNode, resolved) = xref.ConvertToHtmlNode(language, renderer); node.ParentNode.ReplaceChild(convertedNode, node); var warn = xrefSpec == null && xref.ThrowIfNotResolved; return(resolved, warn); }
private static bool UpdateXref(HtmlNode node, IDocumentBuildContext context, string language, out XRefDetails xref) { xref = XRefDetails.From(node); XRefSpec xrefSpec = null; if (!string.IsNullOrEmpty(xref.Uid)) { // Resolve external xref map first, and then internal xref map. // Internal one overrides external one xrefSpec = context.GetXrefSpec(HttpUtility.HtmlDecode(xref.Uid)); xref.ApplyXrefSpec(xrefSpec); } var convertedNode = xref.ConvertToHtmlNode(language); node.ParentNode.ReplaceChild(convertedNode, node); if (xrefSpec == null && xref.ThrowIfNotResolved == true) { return(false); } return(true); }