-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with cyrillic headers #604
Comments
+1 |
+1
|
I support this too. Will it ever be fixed? Or can there be an option to disable automatic id generation? |
I fix it, just read README.md var renderer = new window.marked.Renderer();
renderer.heading = function (text, level)
{
var patt = /\s?{([^}]+)}$/;
var link = patt.exec( text );
if(link && link.length && link[1])
{
text = text.replace(patt, '');
link = link[1];
}
else
{
link = text.toLowerCase().replace(/[^\wА-яіІїЇєЄ]+/gi, '-');
}
return '<h' + level + ' id="' + link + '">' + text + '</h' + level + '>';
}; |
oh, nice. How did I miss it. Thanks. I thinks it would be better to use something like urlify, which will convert cyrillic chars to latin ones, instead of replacing them with null or dash. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
First of all, thanks for great parser and compiler!
Seems that cyrillic generated ids from markdown headers have some issues.
This
# Заголовок
becomes
while it have to be like this:
I understand that it might sound a bit odd, but it's perfectly fine id. Link like
<a href='index.html#заголовок'>link</a>
works as expected (tested in Chrome, Mozilla and IE11).The text was updated successfully, but these errors were encountered: