Skip to content

Commit 8cec2ec

Browse files
committed
Use 3 space indent to support more than 3 levels of toc for GitLab
We found that 2 space indent can not show 3 levels of toc on GitLab, but 3 space indent fix this and doesn't break GitHub. Signed-off-by: Chengwei Yang <[email protected]>
1 parent 51e4538 commit 8cec2ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gh-md-toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ gh_toc_grab() {
120120
# format result line
121121
# * $0 — whole string
122122
echo -e "$(awk -v "gh_url=$1" '{
123-
print sprintf("%*s", substr($0, length($0), 1)*2, " ") "* [" substr($0, match($0, /a>.*<\/h/)+2, RLENGTH-5)"](" gh_url substr($0, match($0, "href=\"[^\"]+?\" ")+6, RLENGTH-8) ")"}' | sed 'y/+/ /; s/%/\\x/g')"
123+
print sprintf("%*s", substr($0, length($0), 1)*3, " ") "* [" substr($0, match($0, /a>.*<\/h/)+2, RLENGTH-5)"](" gh_url substr($0, match($0, "href=\"[^\"]+?\" ")+6, RLENGTH-8) ")"}' | sed 'y/+/ /; s/%/\\x/g')"
124124
}
125125

126126
#

0 commit comments

Comments
 (0)