summaryrefslogtreecommitdiff
path: root/src/index.sh
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2023-03-18 19:37:21 -0700
committerLouie S <louie@example.com>2023-03-18 19:37:21 -0700
commit7115327218452e08fa86c5b279ec16507b75dd8c (patch)
tree1803f8df37e4ea42c896e3cc401dd376e51bb072 /src/index.sh
parentba2e24c9a7beb20281af7357f18b18aa94bd108c (diff)
Prevent newline characters from being in a name
Diffstat (limited to 'src/index.sh')
-rwxr-xr-xsrc/index.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/index.sh b/src/index.sh
index 345c9b3..93ee727 100755
--- a/src/index.sh
+++ b/src/index.sh
@@ -23,7 +23,7 @@ insert() {
insert_term() {
LINK="$1"
- NAME="$(echo "$LINK" | pup -p 'a text{}' | sed 's/"/\"\"/g')"
+ NAME="$(echo "$LINK" | pup -p 'a text{}' | sed 's/"/\"\"/g' | tr -d \\n)"
TYPE="Entry"
PAGE_PATH="$(echo "$LINK" | pup -p 'a attr{href}')"
@@ -34,7 +34,7 @@ insert_term() {
insert_index_terms() {
# Get each term from an index page and insert
while [ -n "$1" ]; do
- grep -Eo "<a href.*></a>" "$1" | while read -r line; do
+ grep -Eo "<a href.*></a>:" "$1" | while read -r line; do
insert_term "$line"
done