keep only perl to get rid of the html

This commit is contained in:
Konstantin 2023-05-29 22:36:38 -04:00 committed by GitHub
parent 52de0983bf
commit 565f5287a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,8 +8,7 @@ dict_lookup=$(sdcv -n --utf8-output -e "$word")
if echo "$dict_lookup" | grep -F -q "Nothing similar to"; then
popup "$dict_lookup"
else
output=$(echo "$dict_lookup" | tail -n +5 | sed 's|<br>|\n|g' | sed 's|<[^>]*>||g')
output=$(echo "$output" | sed -E 's/&(amp|lt|gt|quot);/\1/g')
output=$(echo "$dict_lookup" | tail -n +5 | sed 's|<br>|\n|g')
output=$(echo "$output" | perl -pe 's/<[^>]*>//g')
printf '%s\0' "$output" | xargs -0 -I {} sh -c 'popup "$@"' _ {}
fi