Closed normenmueller closed 7 years ago
Sorry, I couldn't understand what you mean. Please explain more.
Sorry for the confusion.
I'm using your plug-in in combination with MarkdownPreview. There I have the option to post to GitHub for transformation utilizing GitHub's GFM.
There sections get user-content-
prefix. So it would be nice, if there would be an option to specify those prefixes.
Currently, as a dirty workaround I did the following in MarkdownTOC.py
:
$ git diff
diff --git a/MarkdownTOC.py b/MarkdownTOC.py
index 21bf71a..727cd4e 100644
--- a/MarkdownTOC.py
+++ b/MarkdownTOC.py
@@ -185,7 +185,8 @@ class MarkdowntocInsert(sublime_plugin.TextCommand):
# Add indent
for i in range(_indent):
- toc += '\t'
+ # XXX change '\t' to ' '
+ toc += ' '
# Reference-style links: e.g. '# heading [my-anchor]'
list_reference_link = list(pattern_reference_link.finditer(_text))
@@ -220,12 +221,13 @@ class MarkdowntocInsert(sublime_plugin.TextCommand):
level_counters.append(1)
list_prefix = "%d. " % level_counters[-1]
+ # XXX add `user-content-` to work with GFM
if _id == None:
toc += list_prefix + _text + '\n'
elif attrs['bracket'] == 'round':
- toc += list_prefix + '[' + _text + '](#' + _id + ')\n'
+ toc += list_prefix + '[' + _text + '](#user-content-' + _id + ')\n'
else:
- toc += list_prefix + '[' + _text + '][' + _id + ']\n'
+ toc += list_prefix + '[' + _text + '][user-content-' + _id + ']\n'
Cheers, /nm
Hi @normenmueller, this issue is fixed in 2.7.0. It's been a long time, though. 🤕
The following MD
results in
Note the
user-content
prefix!