-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
make slugify function configurable #199
Conversation
Codecov Report
@@ Coverage Diff @@
## master #199 +/- ##
==========================================
+ Coverage 99.71% 99.71% +<.01%
==========================================
Files 1 1
Lines 351 352 +1
Branches 51 52 +1
==========================================
+ Hits 350 351 +1
Misses 1 1
Continue to review full report at Codecov.
|
What’s the reasoning for this? Based on the previous tests with Japanese characters, the browser supported them fine as an anchor. |
Because he closed his pull request, so I have to do it again. At first I wanted to follow his solution(the uri-encoded solution), but after I read your conversations, I think the raw and the uri-encoded solution both have their own scenarios. Therefore, I don't want to introduce a specific solution to the source code. Also, the user can pass the same slugify function to both a toc-generator and this renderer to make it consistent and controllable. By now I have to copy your slugify function into my source code and pass it to the toc-generator. |
We closed it because no work needed to be done.
…On Fri, Jul 27, 2018 at 2:26 PM Andy Wang ***@***.***> wrote:
Because he closed his pull request, so I have to do it again.
At first I wanted to follow his solution(the uri-encoded solution), but
after I read your conversations, I think the raw and the uri-encoded
solution both have their own scenarios. Therefore, I don't want to
introduce a specific solution to the source code.
Also, the user can pass the same slugify function to both a toc-generator
and this renderer to make it consistent and controllable. By now I have to
copy your slugify function into my source code and pass it to the
toc-generator.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#199 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAiy1p_oOE9w09gJ55T0uWCuGATsYBEGks5uK2l7gaJpZM4Vi_JC>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon further consideration, I think this does make sense. I had one nitpick but otherwise looks good!
index.js
Outdated
@@ -712,6 +712,8 @@ const PARSE_PRIORITY_MIN = 5; | |||
export function compiler(markdown, options) { | |||
options = options || {}; | |||
options.overrides = options.overrides || {}; | |||
options.slugify = typeof options.slugify === 'function' ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified to options.slugify || slugify
P.S. It may be a little bothering now since we have reached an agreement. But I think you may misunderstand my intention. Non-alphanumeric headings fails to have an id because of this: It leads to an empty id if the heading is full of non-alphanumeric characters. Therefore, something has to be done. Anyway, thank you very much and I really appreciate your help in resolving the problem! |
Thanks! Will probably cut a release in the next day or two. |
See #198 #177