_html: Ask Perl to parse every and only QStags
This commit is contained in:
		
							
								
								
									
										4
									
								
								qsgen2
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								qsgen2
									
									
									
									
									
								
							@@ -803,7 +803,7 @@ function _html() {
 | 
			
		||||
    if ${debug}; then _msg debug "_html: Converting QStags in content"; fi
 | 
			
		||||
 | 
			
		||||
    # Convert QStags to HTML using Perl, strictly matching the QStags list
 | 
			
		||||
    local html_content=$(echo "${content}" | perl -pe '
 | 
			
		||||
    local html_content=$(echo "${content}" | perl  -0777 -pe '
 | 
			
		||||
        BEGIN {
 | 
			
		||||
            # Define a hash of QStags to their HTML equivalents
 | 
			
		||||
            %qstags = (
 | 
			
		||||
@@ -843,7 +843,7 @@ function _html() {
 | 
			
		||||
        }
 | 
			
		||||
        while (my ($key, $value) = each %qstags) {
 | 
			
		||||
            $key = quotemeta($key); # Escape special characters in QStags
 | 
			
		||||
            s/(?<!\S)$key\b/$value/gi;
 | 
			
		||||
            s/(?<!\S)\Q$key\E\b/$value/g;
 | 
			
		||||
        }
 | 
			
		||||
    ');
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user