From 988bd0e7756ef3f467cd45aa4c2ad893cc3d44dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Tue, 30 Jan 2024 08:52:13 +0100 Subject: [PATCH] Try using Perl to insert page_content into BODY --- qsgen2 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qsgen2 b/qsgen2 index 4fb0939..5650933 100755 --- a/qsgen2 +++ b/qsgen2 @@ -337,8 +337,11 @@ function _pages() { #exit # Insert page_content into pages_tpl by replacing the BODY tag present there - if (${debug}) echo "_pages: Replacing BODY with page_content in pages_tpl" - pages_tpl=$( echo ${pages_tpl} | sed -e "s|BODY|${page_content}|g" ) + if (${debug}) echo "_pages: Replacing BODY with page_content in pages_tpl using Perl" + # Use Perl for multi-line and special character handling + pages_tpl=$( echo "${pages_tpl}" | perl -pe "s|BODY|${page_content}|gs" ) + + # pages_tpl=$( echo ${pages_tpl} | sed -e "s|BODY|${page_content}|g" ) #echo ${pages_tpl} #exit