How can I change the rendering of ID of a Header element? #94

Closed
opened 2026-01-29 14:26:15 +00:00 by claunia · 2 comments
Owner

Originally created by @asapostolov on GitHub (Feb 16, 2017).

I'm converting Cyrillic alphabet markdown to html. When h2/3/4/5 elements are made when the alphabet is Latin the header's text is converted to id in a proper way. However when the alphabet is Cyrillic the id-s of the headers become section-1, section-2, section-3 etc.

How can I modify that behavior to be able to generate proper Cyrillic ids?

Originally created by @asapostolov on GitHub (Feb 16, 2017). I'm converting Cyrillic alphabet markdown to html. When h2/3/4/5 elements are made when the alphabet is Latin the header's text is converted to id in a proper way. However when the alphabet is Cyrillic the id-s of the headers become `section-1`, `section-2`, `section-3` etc. How can I modify that behavior to be able to generate proper Cyrillic ids?
claunia added the question label 2026-01-29 14:26:16 +00:00
Author
Owner

@xoofx commented on GitHub (Feb 17, 2017):

By default, the auto-identifier tries to convert to ASCII using some character correspondence. Can you post an example headers with cyrillic alphabet?

Otherwise, you should be able to disable the ASCII conversion:

// Remove the previous AutoIdentifierExtension
pipelineBuilder.Extensions.Remove(pipeline.Extensions.Find<AutoIdentifierExtension>());
// Add AutoIdentifier extension with only AutoLink option
pipelineBuilder.UseAutoIdentifiers(AutoIdentifierOptions.AutoLink);
@xoofx commented on GitHub (Feb 17, 2017): By default, the auto-identifier tries to convert to ASCII using some character correspondence. Can you post an example headers with cyrillic alphabet? Otherwise, you should be able to disable the ASCII conversion: ```csharp // Remove the previous AutoIdentifierExtension pipelineBuilder.Extensions.Remove(pipeline.Extensions.Find<AutoIdentifierExtension>()); // Add AutoIdentifier extension with only AutoLink option pipelineBuilder.UseAutoIdentifiers(AutoIdentifierOptions.AutoLink); ```
Author
Owner

@asapostolov commented on GitHub (Feb 20, 2017):

Here's an Cyrillic Header

Здравейте, аз съм Петър и съм програмист

When I did as you said - I removed the extension and used AutoLink - the Ids started converting properly to Cyrillic. Thanks!

@asapostolov commented on GitHub (Feb 20, 2017): Here's an Cyrillic Header ` Здравейте, аз съм Петър и съм програмист ` When I did as you said - I removed the extension and used `AutoLink` - the Ids started converting properly to Cyrillic. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#94