Skip to content

Commit 6f9365d

Browse files
authored
Merge pull request #35 from aureliojargas/patch-1
Use case builtin for pattern matching
2 parents baf5005 + 2b8c6a7 commit 6f9365d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

gh-md-toc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ gh_toc_md2html() {
6060
# Is passed string url
6161
#
6262
gh_is_url() {
63-
if [[ $1 == https* || $1 == http* ]]; then
64-
echo "yes"
65-
else
66-
echo "no"
67-
fi
63+
case $1 in
64+
https* | http*)
65+
echo "yes";;
66+
*)
67+
echo "no";;
68+
esac
6869
}
6970

7071
#

0 commit comments

Comments
 (0)