markdown-toc
markdown-toc copied to clipboard
Allow custom open and close parameters
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.
Thanks @PrimordialHelios I'll try to review this today.
Thanks! Take your time with it, I understand you're busy so I don't mind waiting :)
@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.
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
I've never written unit tests before
These are great! I think it looks good. I'll try to get this merged in soon.
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.
@doowb Just figured I'd ping you in case you'd forgotten about this PR
Can we get this merged? This would be a very useful feature.