• Resolved jugglinmike

    (@jugglinmike)


    Input:

    
    <p>p1 l1   inside   p1 l1</p>
    
    <p>p2 l1 end
    p2 l2</p>
    
    <p>p3 l1
    begin p3 l2</p>
    

    Expected:

    
    <p>p1 l1 inside p1 l1</p><p>p2 l1 end p2 l2</p><p>p3 l1 begin p3 l2</p>
    

    (white space surrounding the emphasis element in all cases)

    Actual:

    
    <p>p1 l1 inside p1 l1</p><p>p2 l1 endp2 l2</p><p>p3 l1begin p3 l2</p>
    

    (white space contributed by newlines removed)

    • This topic was modified 6 years, 1 month ago by jugglinmike. Reason: Attempt to correct formatting of example code
    • This topic was modified 6 years, 1 month ago by jugglinmike. Reason: Attempt to correct formatting of example code
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jugglinmike

    (@jugglinmike)

    Apologies: I’m having trouble formatting this report in a way that preserves the relevant markup. I’ve copied it to another page where I can verify the rendering:

    https://gist.github.com/jugglinmike/facaedcb9706cd9d9b5d9a959e67c05b

    Thread Starter jugglinmike

    (@jugglinmike)

    I’ve developed a fix, but I can’t find contact information for the author. Posting it here in the hopes that they see it and apply it:

                 $process = $split[$i];
                 $asis = '';
         }
        -$process = preg_replace(array ('/\>[^\S ]+' . $mod, '/[^\S ]+\<' . $mod, '/(\s)+' . $mod), array('>', '<', '\\1'), $process);
        +$process = preg_replace(array ('/\>([^\S ])+' . $mod, '/([^\S ])+\<' . $mod, '/(\s)+' . $mod), array('>\\1', '\\1<', '\\1'), $process);
         if ( $minify_html_comments != 'no' )
                 $process = preg_replace('/<!--(?!\s*(?:\[if [^\]]+]|<!|>))(?:(?!-->).)*-->' . $mod, '', $process);
         $buffer .= $process.$asis;
    
    • This reply was modified 6 years, 1 month ago by jugglinmike. Reason: correct code formatting
    • This reply was modified 6 years, 1 month ago by jugglinmike. Reason: Another attempt to correct formatting
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Newlines not recognized when preserving significant white space’ is closed to new replies.