markdown-toc icon indicating copy to clipboard operation
markdown-toc copied to clipboard

Allow custom open and close parameters

Open ghost opened this issue 7 years ago • 8 comments

In reference to #109

Here's what I have so far. The code might not be the greatest, but I thought it would be best to get down a starting point and see what you guys thought.

ghost avatar Dec 14 '17 01:12 ghost

Thanks @PrimordialHelios I'll try to review this today.

doowb avatar Dec 16 '17 16:12 doowb

Thanks! Take your time with it, I understand you're busy so I don't mind waiting :)

ghost avatar Dec 17 '17 22:12 ghost

@PrimordialHelios thanks for the PR. Will you add some tests to this section for testing the .insert method?

Also, I think some changes will be necessary here to ensure the plugin works correctly. I think some tests using it as a remarkable plugin will cover that part.

doowb avatar Dec 20 '17 22:12 doowb

I've never written unit tests before, so I added some testing with custom open and close options to test the regex. Mind looking at them and letting me know if I should do anything different?

https://github.com/PrimordialHelios/markdown-toc/blob/af52bbfa0390683aed7594cf7c7ec853e9cffa07/test/test.js#L408-L422

EDIT: Updated link with a newer commit

ghost avatar Dec 21 '17 00:12 ghost

I've never written unit tests before

These are great! I think it looks good. I'll try to get this merged in soon.

doowb avatar Dec 21 '17 03:12 doowb

Awesome, thanks! I tried squashing all the commits to make it easier to deal with. I think I got it right, but if there's anything wrong with it, just let me know and I'll sort it out.

ghost avatar Dec 21 '17 23:12 ghost

@doowb Just figured I'd ping you in case you'd forgotten about this PR

ghost avatar Jan 11 '18 16:01 ghost

Can we get this merged? This would be a very useful feature.

slavaaaaaaaaaa avatar Aug 09 '18 21:08 slavaaaaaaaaaa