summaryrefslogtreecommitdiff
path: root/packages/html.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2021-05-20 17:51:07 +0100
committerPaul Buetow <git@mx.buetow.org>2021-05-21 05:11:05 +0100
commit65f8a2497bad58619d0cfdc76e4a0efeb15e0306 (patch)
tree7d48e069ea8aaf0384f63dc7f8cf5477aa7f9848 /packages/html.source.sh
parent9f8424f2e09db260ae85db7a326fb1aea6ae1902 (diff)
initial macos support
Diffstat (limited to 'packages/html.source.sh')
-rw-r--r--packages/html.source.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/html.source.sh b/packages/html.source.sh
index 5a292f1..a258781 100644
--- a/packages/html.source.sh
+++ b/packages/html.source.sh
@@ -10,7 +10,10 @@ html::encode () {
# Make a HTML paragraph.
html::make_paragraph () {
local -r text="$1"; shift
- test -n "$text" && echo "<p>$(html::encode "$text")</p>"
+
+ if [[ -n "$text" ]]; then
+ echo "<p>$(html::encode "$text")</p>"
+ fi
}
# Make a HTML header.
@@ -46,8 +49,13 @@ html::make_link () {
local link="$1"; shift
local descr="$1"; shift
- $GREP -F -q '://' <<< "$link" || link=${link/.gmi/.html}
- test -z "$descr" && descr="$link"
+ if $GREP -F -q '://' <<< "$link"; then
+ link=${link/.gmi/.html}
+ fi
+ if [[ -z "$descr" ]]; then
+ descr="$link"
+ fi
+
echo "<a class=\"textlink\" href=\"$link\">$descr</a><br />"
}