diff --git a/qsgen2 b/qsgen2 index bca2097..82877b4 100755 --- a/qsgen2 +++ b/qsgen2 @@ -510,11 +510,14 @@ function _pages() { # Grab the title from the Page if (${debug}) _msg debug "_pages: Finding page_title" if [[ ${generator} == "native" ]]; then - # Use Zsh built in functions to find page_title - if [[ "${page_content}" =~ ^#title=(.*) ]]; then - local page_title=$match[1] - #local page_title=$( echo ${page_content} | head -2 | grep \#title | cut -d= -f2 ) - fi + while read -r line + do + if [[ "$line" =~ ^#title=(.*) ]]; then + local page_title=${match[1]} + break + #local page_title=$( echo ${page_content} | head -2 | grep \#title | cut -d= -f2 ) + fi + done <<< "$page_content" elif [[ ${generator} == "markdown" ]]; then while IFS= read -r line do