[Rt-commit] rt branch, 4.0/plain-text-attachment-display, created. rt-4.0.10-70-g86f7b03

Thomas Sibley trs at bestpractical.com
Fri Mar 1 20:52:42 EST 2013


The branch, 4.0/plain-text-attachment-display has been created
        at  86f7b03372df6f30fb8e9aad043b9b4721dc4eb8 (commit)

- Log -----------------------------------------------------------------
commit 86f7b03372df6f30fb8e9aad043b9b4721dc4eb8
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Mar 1 17:45:30 2013 -0800

    Respect plain text display preferences for all plain text content
    
    Attachments with filenames are never parsed with Text::Quoted, so the
    passed in $Message content was never an array reference.  This caused
    textual attachments to ignore the PlainTextPre and PlainTextMono
    settings, the symptom of which is nigh unreadable text.  Moving those
    preferences out of the conditional corrects the display.  Now every call
    to ShowMessageStanza with a text/plain content type will result in a
    <div class="message-stanza">, which may be white-space preserving and/or
    wrapped in a <pre>.

diff --git a/share/html/Ticket/Elements/ShowMessageStanza b/share/html/Ticket/Elements/ShowMessageStanza
index beca35c..716bdfb 100644
--- a/share/html/Ticket/Elements/ShowMessageStanza
+++ b/share/html/Ticket/Elements/ShowMessageStanza
@@ -77,16 +77,16 @@ my $print_content = sub {
     $m->out($$ref);
 };
 
-if ( ref $Message ) {
-    $m->out('<pre>')
-        if (    $ContentType eq 'text/plain'
-             && $plain_text_pre
-             && !$Depth
-             && !$plain_text_mono );
-    $m->out(   '<div class="message-stanza'
-             . ( ($ContentType eq 'text/plain' &&  $plain_text_mono) ? ' plain-text-white-space' : '' ) . '"'
-             . '>' );
+$m->out('<pre>')
+    if (    $ContentType eq 'text/plain'
+         && $plain_text_pre
+         && !$Depth
+         && !$plain_text_mono );
+$m->out(   '<div class="message-stanza'
+         . ( ($ContentType eq 'text/plain' &&  $plain_text_mono) ? ' plain-text-white-space' : '' ) . '"'
+         . '>' );
 
+if ( ref $Message ) {
     my @stack;
     my $para = '';
     my $i    = 0;
@@ -170,16 +170,16 @@ AGAIN: foreach ( ; $i < @$Message; $i++ ) {
         $m->out('</div>');
         goto AGAIN;
     }
-
-    $m->out('</div>');
-    $m->out('</pre>')
-        if (    $ContentType eq 'text/plain'
-             && $plain_text_pre
-             && !$Depth
-             && !$plain_text_mono );
 } else {
     $print_content->( \$Message );
 }
+
+$m->out('</div>');
+$m->out('</pre>')
+    if (    $ContentType eq 'text/plain'
+         && $plain_text_pre
+         && !$Depth
+         && !$plain_text_mono );
 </%INIT>
 <%ARGS>
 $Message => undef

-----------------------------------------------------------------------


More information about the Rt-commit mailing list