public void Execute(BlogPostConversionData postConversionData) { var post = postConversionData.Post; var markdown = post.Content.Text; markdown = ReverseMarkdownHelper .DecodeAfterConversion(markdown); post.Content = BlogMLContent.Create( markdown, ContentTypes.Text); }
private void EncodeSpecialCharactersInHugoShortcodes(HtmlDocument doc) { // Find elements containing a Hugo shortcode (e.g. // "{{< figure... >}}" var elements = doc.DocumentNode.SelectNodes( "//*[contains(text(), '{{<')]/text()"); if (elements != null) { foreach (var element in elements) { Debug.Assert(element.Name == "#text"); var textNode = element; textNode.InnerHtml = ReverseMarkdownHelper .EncodeBeforeConversion(textNode.InnerHtml); } } }