From 7115327218452e08fa86c5b279ec16507b75dd8c Mon Sep 17 00:00:00 2001 From: Louie S Date: Sat, 18 Mar 2023 19:37:21 -0700 Subject: Prevent newline characters from being in a name --- src/index.sh | 4 ++-- 1 file 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 "" "$1" | while read -r line; do + grep -Eo ":" "$1" | while read -r line; do insert_term "$line" done -- cgit