Uh oh!
There was an error while loading. Please reload this page.
Fix Heading ID for Unicode text - #1374
Conversation
Defining `nonWordCharacters` seems to solve it. Reference: [atom nonWordCharacters](https://github.com/atom/atom/blob/080d6ae1279c66e5f018d803186a0cde5c202c03/src/config-schema.js?fbclid=IwAR0BI3l0KgHls4gGlFw0HYQ_G_U7A84X0eTtmSvfEauo8NCnQxpRKuGJnQM#L450)
UziTech
commented
Nov 7, 2018
according to the spec:
so couldn't we change it to |
UziTech
commented
Nov 7, 2018
I suppose we would want to remove All other characters seem to work fine in ids on chrome. |
Maybe, need to consider the behavior of shared URL with fragment (section ID). e.g. I'm sorry, I closed it by mistake in the mark down test. |
styfle
commented
Nov 12, 2018
This feature (header id) is being removed in PR #1354 so I don't think it's worth pursuing in this PR. |
k-utsumi
commented
Nov 13, 2018
Thanks😄 |
k-utsumi
commented
Dec 6, 2018
I want to eliminate this problem quickly, so I reopened with a simple code adjustment. |
UziTech
commented
Dec 6, 2018
@styfle do we want to add a |
styfle
commented
Dec 6, 2018
@UziTech If we are not going to remove it, we could go all-out and implement like so: functionSlugger(){this.seen={};}Slugger.prototype.slug=function(value){varslug=value.toLowerCase().trim().replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,'').replace(/\s/g,'-');varcount=this.seen.hasOwnProperty(slug) ? this.seen[slug]+1 : 0;this.seen[slug]=count;if(count>0){slug=slug+'-'+count;}returnslug;};I think we'll need some unit tests to see what will and will not match as far as unicode goes. That was one of the reasons why I was trying to tear it out, so the implementation and tests could live in |
UziTech
commented
Dec 6, 2018
I think not having dependencies is one of the big benefits of marked so if we want to have ids be part of gfm we will need to incorporate slugger into our code. |
styfle
commented
Dec 9, 2018
@k-utsumi Would you like to update this PR with the slugger or should I create a new PR? |
k-utsumi
commented
Dec 20, 2018
@styfle |
styfle
commented
Dec 20, 2018
Yes, I will create a PR this weekend with the appropriate change. |
styfle
commented
Dec 20, 2018
Closing in favor of #1401 |
I think defining
nonWordCharacterswill solve it.Reference: atom nonWordCharacters