Example #1
0
        public object GetExtra(XElement element, dynamic currentModel)
        {
            var xAttribute = element.Attribute("Location");
            if (xAttribute == null)
                return string.Empty;

            var fileLocation = Path.Combine(configuration.TemplateRootFolder, xAttribute.Value);

            var options = new MarkdownOptions
            {
                AutoHyperlink = true,
                AutoNewlines = true,
                EmptyElementSuffix = "/>",
                EncodeProblemUrlCharacters = false,
                LinkEmails = true,
                StrictBoldItalic = true
            };

            var parser = new Markdown(options);

            var result = parser.Transform(File.ReadAllText(fileLocation));

            return result;
        }
Example #2
0
 /// <summary>
 /// Create a new Markdown instance and set the options from the MarkdownOptions object.
 /// </summary>
 public Markdown(MarkdownOptions options)
 {
     _autoHyperlink = options.AutoHyperlink;
     _autoNewlines = options.AutoNewlines;
     _emptyElementSuffix = options.EmptyElementSuffix;
     _encodeProblemUrlCharacters = options.EncodeProblemUrlCharacters;
     _linkEmails = options.LinkEmails;
     _strictBoldItalic = options.StrictBoldItalic;
 }