File tree Expand file tree Collapse file tree 7 files changed +22
-23
lines changed
commonMain/kotlin/ch/derlin/bitdowntoc
commonTest/kotlin/ch.derlin.bitdowntoc Expand file tree Collapse file tree 7 files changed +22
-23
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ object BitGenerator {
7
7
private const val tocMarker = " [TOC]"
8
8
9
9
private val headerRegex = Regex (" (#+) +([^ ]+.*)" )
10
- private val codeRegex = Regex (" ^```\\ w* *$" )
11
10
12
11
data class Params (
13
12
val indentChars : String = BitOptions .indentChars.default,
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class Toc(
40
40
val minIndent = if (trimTocIndent) entries.minOf { it.indent } else 0
41
41
return entries.joinToString(" \n " ) { (indent, text, link) ->
42
42
(indent - minIndent).let {
43
- " " .repeat(it * 2 ) + " ${indentCharacters[it % indentCharacters.length]} [$text ](#$link )"
43
+ " " .repeat(it * 3 ) + " ${indentCharacters[it % indentCharacters.length]} [$text ](#$link )"
44
44
}
45
45
}
46
46
}
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class GenerateTest {
54
54
<!-- TOC start (generated with $BITDOWNTOC_URL ) -->
55
55
56
56
- [heading](#heading)
57
- * [subheading](#subheading)
57
+ * [subheading](#subheading)
58
58
- [heading](#heading-1)
59
59
60
60
<!-- TOC end -->
@@ -146,7 +146,7 @@ class GenerateTest {
146
146
<!-- TOC start (generated with $BITDOWNTOC_URL ) -->
147
147
148
148
- [heading](#heading)
149
- * [subheading](#subheading)
149
+ * [subheading](#subheading)
150
150
- [heading](#heading-1)
151
151
152
152
<!-- TOC end -->
@@ -208,7 +208,7 @@ class GenerateTest {
208
208
assertEquals(
209
209
"""
210
210
- [Some readme](#some-readme)
211
- * [hello](#hello)
211
+ * [hello](#hello)
212
212
213
213
<a name="some-readme"></a>
214
214
# Some readme
@@ -277,7 +277,7 @@ class GenerateTest {
277
277
<!-- TOC start (generated with $BITDOWNTOC_URL ) -->
278
278
279
279
- [h1](#h1)
280
- * [h2](#h2)
280
+ * [h2](#h2)
281
281
282
282
<!-- TOC end -->
283
283
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class UpdateAnchorsTest {
37
37
<!-- TOC start (generated with $BITDOWNTOC_URL ) -->
38
38
39
39
- [modified heading](#modified-heading)
40
- * [sub heading different](#sub-heading-different)
40
+ * [sub heading different](#sub-heading-different)
41
41
- [Hello World !](#hello-world-)
42
42
43
43
<!-- TOC end -->
@@ -87,7 +87,7 @@ class UpdateAnchorsTest {
87
87
<!-- TOC start (generated with $BITDOWNTOC_URL ) -->
88
88
89
89
- [modified heading](#modified-heading)
90
- * [sub heading different](#sub-heading-different)
90
+ * [sub heading different](#sub-heading-different)
91
91
- [Hello World !](#hello-world-)
92
92
93
93
<!-- TOC end -->
Original file line number Diff line number Diff line change 1
1
<!-- TOC start (generated with https://github.com/derlin/bitdowntoc) -->
2
2
3
3
- [ A heading with spaces] ( #a-heading-with-spaces )
4
- * [ Some '??&%' strange :) characters] ( #some-strange-characters )
5
- * [ 😋 Get Emoji — All Emojis to Copy and 📋 Paste 👌] ( #-get-emoji-all-emojis-to-copy-and-paste- )
6
- + [ Russian text is not supported] ( #russian-text-is-not-supported )
7
- - [ dès la matinée, ça gït] ( #dès-la-matinée-ça-gït )
4
+ * [ Some '??&%' strange :) characters] ( #some-strange-characters )
5
+ * [ 😋 Get Emoji — All Emojis to Copy and 📋 Paste 👌] ( #-get-emoji-all-emojis-to-copy-and-paste- )
6
+ + [ Russian text is not supported] ( #russian-text-is-not-supported )
7
+ - [ dès la matinée, ça gït] ( #dès-la-matinée-ça-gït )
8
8
- [ this is a duplicate] ( #this-is-a-duplicate )
9
9
- [ this is a duplicate] ( #this-is-a-duplicate-1 )
10
10
- [ this is a duplicate] ( #this-is-a-duplicate-2 )
11
- * [ ?)= ALKJDFEEE* ç] ( #-alkjdfeeeç )
11
+ * [ ?)= ALKJDFEEE* ç] ( #-alkjdfeeeç )
12
12
13
13
<!-- TOC end -->
14
14
Original file line number Diff line number Diff line change 1
1
<!-- TOC start (generated with https://github.com/derlin/bitdowntoc) -->
2
2
3
3
- [ A heading with spaces] ( #a-heading---with---spaces )
4
- * [ Some '??&%' strange :) characters] ( #some--strange--characters )
5
- * [ 😋 Get Emoji — All Emojis to Copy and 📋 Paste 👌] ( #-get-emoji--all-emojis-to-copy-and--paste- )
6
- + [ Russian text is not supported] ( #russian-text-is-not-supported )
7
- - [ dès la matinée, ça gït] ( #dès-la-matinée-ça-gït )
4
+ * [ Some '??&%' strange :) characters] ( #some--strange--characters )
5
+ * [ 😋 Get Emoji — All Emojis to Copy and 📋 Paste 👌] ( #-get-emoji--all-emojis-to-copy-and--paste- )
6
+ + [ Russian text is not supported] ( #russian-text-is-not-supported )
7
+ - [ dès la matinée, ça gït] ( #dès-la-matinée-ça-gït )
8
8
- [ this is a duplicate] ( #this-is-a-duplicate )
9
9
- [ this is a duplicate] ( #this-is-a-duplicate-1 )
10
10
- [ this is a duplicate] ( #this-is---a-duplicate )
11
- * [ ?)= ALKJDFEEE* ç] ( #-alkjdfeeeç )
11
+ * [ ?)= ALKJDFEEE* ç] ( #-alkjdfeeeç )
12
12
13
13
<!-- TOC end -->
Original file line number Diff line number Diff line change 1
1
<!-- TOC start (generated with https://github.com/derlin/bitdowntoc) -->
2
2
3
3
- [ A heading with spaces] ( #a-heading-with-spaces )
4
- * [ Some '??&%' strange :) characters] ( #some-strange-characters )
5
- * [ 😋 Get Emoji — All Emojis to Copy and 📋 Paste 👌] ( #-get-emoji-all-emojis-to-copy-and-paste- )
6
- + [ Russian text is not supported] ( #russian-text-is-not-supported )
7
- - [ dès la matinée, ça gït] ( #dès-la-matinée-ça-gït )
4
+ * [ Some '??&%' strange :) characters] ( #some-strange-characters )
5
+ * [ 😋 Get Emoji — All Emojis to Copy and 📋 Paste 👌] ( #-get-emoji-all-emojis-to-copy-and-paste- )
6
+ + [ Russian text is not supported] ( #russian-text-is-not-supported )
7
+ - [ dès la matinée, ça gït] ( #dès-la-matinée-ça-gït )
8
8
- [ this is a duplicate] ( #this-is-a-duplicate )
9
9
- [ this is a duplicate] ( #this-is-a-duplicate-1 )
10
10
- [ this is a duplicate] ( #this-is-a-duplicate-2 )
11
- * [ ?)= ALKJDFEEE* ç] ( #-alkjdfeeeç )
11
+ * [ ?)= ALKJDFEEE* ç] ( #-alkjdfeeeç )
12
12
13
13
<!-- TOC end -->
You can’t perform that action at this time.
0 commit comments