bugfix: remove description

This commit is contained in:
Ämin Baumeler 2025-06-17 15:11:49 +02:00
parent 648ff6c016
commit 6d1d5ce1c6
2 changed files with 10 additions and 11 deletions

View File

@ -43,7 +43,7 @@ BEGIN {
FS=":" FS=":"
zulu = strftime("%Y%m%dT%H%M%SZ", systime(), 1) zulu = strftime("%Y%m%dT%H%M%SZ", systime(), 1)
} }
desc { desc = desc "\\n" $0; next } readdesc { desc = desc ? desc "\\n" escape($0) : escape($0); next }
{ {
from = substr($0, 1, 6) == "::: |>" ? substr($0, 8) : "" from = substr($0, 1, 6) == "::: |>" ? substr($0, 8) : ""
if (!from) if (!from)
@ -53,14 +53,15 @@ desc { desc = desc "\\n" $0; next }
if (!to) if (!to)
exit 1 exit 1
getline getline
location = substr($0, 1, 2) == "@ " ? substr($0, 3) : "" location = substr($0, 1, 2) == "@ " ? escape(substr($0, 3)) : ""
if (location) getline if (location) getline
summary = substr($0, 1, 2) == "# " ? substr($0, 3) : "" summary = substr($0, 1, 2) == "# " ? escape(substr($0, 3)) : ""
if (!summary) if (!summary)
exit 1 exit 1
getline # This line should be empty getline # This line should be empty
getline # First line of description if ($0 != "")
desc = $0 exit 1
readdesc = 1
next next
} }
END { END {
@ -113,9 +114,6 @@ END {
if (suc != 1) { if (suc != 1) {
exit 1 exit 1
} }
summary = escape(summary)
location = escape(location)
desc = escape(desc)
# print ical # print ical
print "BEGIN:VCALENDAR" print "BEGIN:VCALENDAR"

View File

@ -95,7 +95,7 @@ ENDFILE {
} }
} }
NR == FNR && desc { desc = desc "\\n" escape($0); next } NR == FNR && readdesc { desc = desc ? desc "\\n" escape($0) : escape($0); next }
NR == FNR { NR == FNR {
from = substr($0, 1, 6) == "::: |>" ? substr($0, 8) : "" from = substr($0, 1, 6) == "::: |>" ? substr($0, 8) : ""
if (!from) if (!from)
@ -111,8 +111,9 @@ NR == FNR {
if (!summary) if (!summary)
exit 1 exit 1
getline # This line should be empty getline # This line should be empty
getline # First line of description if ($0 != "")
desc = escape($0) exit 1
readdesc = 1
next next
} }