private static IEnumerable<YamlHtmlPart> MarkupMultiple(IHostService host, string markdown, FileAndType ft) { try { var html = host.Markup(markdown, ft, true); var parts = YamlHtmlPart.SplitYamlHtml(html); foreach (var part in parts) { var mr = host.Parse(part.ToMarkupResult(), ft); part.Conceptual = mr.Html; part.LinkToFiles = mr.LinkToFiles; part.LinkToUids = mr.LinkToUids; part.YamlHeader = mr.YamlHeader; part.FileLinkSources = mr.FileLinkSources; part.UidLinkSources = mr.UidLinkSources; } return parts; } catch (Exception ex) { System.Diagnostics.Debug.Fail("Markup failed!"); var message = $"Markup failed: {ex.Message}."; Logger.LogError(message); throw new DocumentException(message, ex); } }
private static IEnumerable <YamlHtmlPart> MarkupMultiple(IHostService host, string markdown, FileAndType ft) { try { var html = host.Markup(markdown, ft, true); var parts = YamlHtmlPart.SplitYamlHtml(html); foreach (var part in parts) { var mr = host.Parse(part.ToMarkupResult(), ft); part.Conceptual = mr.Html; part.LinkToFiles = mr.LinkToFiles; part.LinkToUids = mr.LinkToUids; part.YamlHeader = mr.YamlHeader; part.FileLinkSources = mr.FileLinkSources; part.UidLinkSources = mr.UidLinkSources; } return(parts); } catch (Exception ex) { System.Diagnostics.Debug.Fail("Markup failed!"); var message = $"Markup failed: {ex.Message}."; Logger.LogError(message); throw new DocumentException(message, ex); } }
private static IEnumerable <YamlHtmlPart> MarkupMultiple(IHostService host, string markdown, FileAndType ft) { try { var html = host.Markup(markdown, ft, true); var parts = YamlHtmlPart.SplitYamlHtml(html); foreach (var part in parts) { var mr = host.Parse(part.ToMarkupResult(), ft); part.Conceptual = mr.Html; part.LinkToFiles = mr.LinkToFiles; part.LinkToUids = mr.LinkToUids; part.YamlHeader = mr.YamlHeader; } return(parts); } catch (Exception ex) { System.Diagnostics.Debug.Fail("Markup failed!"); Logger.LogWarning($"Markup failed:{Environment.NewLine} Markdown: {markdown}{Environment.NewLine} Details:{ex.ToString()}"); return(Enumerable.Empty <YamlHtmlPart>()); } }