Isn't it support the anchor? #452

Closed
opened 2026-01-29 14:37:08 +00:00 by claunia · 1 comment
Owner

Originally created by @jamesnet214 on GitHub (Apr 8, 2021).

code (convert to html)

var pipline = new MarkdownPipelineBuilder().UsePipeTables().UseGridTables()
    .UseAdvancedExtensions().UseEmojiAndSmiley().Build();
string html = Markdig.Markdown.ToHtml(Markdown, pipline);

Markdown

[header](#1-header) 
# 1. Header

HTML

<a href="1-header">1. Header</h1>

<h1 id="header">1. Header</h1>

Is there a way to accurately convert id? Or did I miss something?

Originally created by @jamesnet214 on GitHub (Apr 8, 2021). `code` (convert to html) ```csharp var pipline = new MarkdownPipelineBuilder().UsePipeTables().UseGridTables() .UseAdvancedExtensions().UseEmojiAndSmiley().Build(); string html = Markdig.Markdown.ToHtml(Markdown, pipline); ``` `Markdown` ```markdown [header](#1-header) # 1. Header ``` `HTML` ```html <a href="1-header">1. Header</h1> <h1 id="header">1. Header</h1> ``` Is there a way to accurately convert id? Or did I miss something?
claunia added the invalid label 2026-01-29 14:37:08 +00:00
Author
Owner

@xoofx commented on GitHub (Apr 27, 2021):

The default mode does not support digits as 1st character. You should use AutoIdentifierOptions.GitHub. The doc doesn't explain the difference but the code is here (Urilize vs UrilizeAsGfm)

@xoofx commented on GitHub (Apr 27, 2021): The default mode does not support digits as 1st character. You should use [AutoIdentifierOptions.GitHub](https://github.com/xoofx/markdig/blob/0a0040450fd4f774dacc71bcaf0ed1651a792cea/src/Markdig/Extensions/AutoIdentifiers/AutoIdentifierOptions.cs#L35-L38). The doc doesn't explain the difference but the code is [here](https://github.com/xoofx/markdig/blob/0a0040450fd4f774dacc71bcaf0ed1651a792cea/src/Markdig/Helpers/LinkHelper.cs#L22-L111) (`Urilize` vs `UrilizeAsGfm`)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#452