MarkdownDeep AutoHeadingIDs are not working

53 Views Asked by At

I'm working with MarkdownDeep in my WebSite:

public static MvcHtmlString FromMarkdown(this HtmlHelper helper, string value)
{
    var md = new Markdown
    {
        ExtraMode = true,
        SafeMode = true,
        NewWindowForExternalLinks = true,
        MarkdownInHtml = true,
        AutoHeadingIDs = true
    };

    text = md.Transform(value);

    return MvcHtmlString.Create(text);
}

My problem here is, that headings still not get IDs since I want to work with anchors. Anyone an idea?

1

There are 1 best solutions below

0
On BEST ANSWER

The problem was that you can't use property SafeMode together with AutoHeadingIDs. It's not documented but it solved my problem. Initialization now looks:

var md = new Markdown
{
    ExtraMode = true,
    NewWindowForExternalLinks = true,
    MarkdownInHtml = true,
    AutoHeadingIDs = true
};