OSDN Git Service

escape html markup in notif center
authorpaperbenni <paperbenni@gmail.com>
Tue, 24 Mar 2020 14:32:27 +0000 (15:32 +0100)
committerpaperbenni <paperbenni@gmail.com>
Tue, 24 Mar 2020 14:32:27 +0000 (15:32 +0100)
programs/dunsttrigger

index 6a404c7..21e5f51 100755 (executable)
@@ -7,6 +7,7 @@ if echo "$2" | grep -q 'instantASSIST'; then
     exit
 fi
 
+# some apps dont need/already have notification sounds
 if ! echo "$1" | grep -Eiq '(discord|spotify|thunderbird|mailspring)'; then
     if ! [ -e ~/instantos/notifications/notification.ogg ]; then
         if ping -c 1 google.com; then
@@ -21,9 +22,8 @@ if ! echo "$1" | grep -Eiq '(discord|spotify|thunderbird|mailspring)'; then
 fi
 
 # escape characters that cause problems with pango
-# some apps dont need/already have notification sounds
 cleanstring() {
-    echo "$@" | sed 's/&/&amp;/g'
+    echo "$@" | sed 's/&/&amp;/g' | sed 's/<.*>\(.*\)<\/.*>/\1/g'
 }
 
 # add pango markup