]> git.plutz.net Git - invoices/commitdiff
handle line breaks in $time and $work definitions
authorPaul Hänsch <paul@plutz.net>
Mon, 25 Jul 2022 12:34:06 +0000 (14:34 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 25 Jul 2022 12:34:06 +0000 (14:34 +0200)
odtgen.sh

index 1dfa5e87083d736bdc31035e19f81d7b14e12da0..abed2db2028e43f153aee28ec1d4f2701e8000f0 100755 (executable)
--- a/odtgen.sh
+++ b/odtgen.sh
@@ -178,8 +178,8 @@ odt_content(){
                  </table:table-row>
                </table:table-header-rows>
                $(sed 1d "invoices/$id" |while read -r time work hours; do
                  </table:table-row>
                </table:table-header-rows>
                $(sed 1d "invoices/$id" |while read -r time work hours; do
-                   time="$(UNSTRING "${time#time=}" |sed 's;\r;<text:line-break/>;g')"
-                   work="$(UNSTRING "${work#work=}" |sed 's;\r;<text:line-break/>;g')"
+                   time="$(UNSTRING "${time#time=}" |sed -r 's;(&#13\;)?&#10\;|(&#x0?[Dd]\;)?&#x0?[aA]\;|\r?$;<text:line-break/>;g')"
+                   work="$(UNSTRING "${work#work=}" |sed -r 's;(&#13\;)?&#10\;|(&#x0?[Dd]\;)?&#x0?[aA]\;|\r?$;<text:line-break/>;g')"
                   hours="$(UNSTRING "${hours#hours=}")"
                  cat <<-TROW
                        <table:table-row>
                   hours="$(UNSTRING "${hours#hours=}")"
                  cat <<-TROW
                        <table:table-row>