Making WordPress.org

Changeset 12170


Ignore:
Timestamp:
10/31/2022 07:39:54 AM (20 months ago)
Author:
dd32
Message:

Trac: PR Bot: Better formatting for when a comment is synced over from GitHub to Trac.

See #6555.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/trac.wordpress.org/templates/ticket_change.html

    r12168 r12170  
    5454  </h3>
    5555</py:when>
    56 <py:when test="'author' in change and 'prbot' == change.author and change.comment.startswith('\'\'')"
    57          py:with="
    58            wporg_user  = wporg_sanitize_user_nicename(change.author);
    59            pr_byline   = change.comment.partition('\n')[0];
    60            pr_comment  = ''.join(change.comment.partition('\n')[1:]) or False;
    61            prbot_class = 'prbot with-context' if pr_comment or change.fields else 'prbot without-context';
    62          ">
     56<py:when test="'author' in change and 'prbot' == change.author"
     57        py:with="
     58          wporg_user   = wporg_sanitize_user_nicename(change.author);
     59          display_text = re.sub( '[{]+#!comment[^}]+[}]+', '', change.comment ).lstrip();
     60          pr_byline    = display_text.partition('\n')[0];
     61          pr_comment   = ''.join(display_text.partition('\n')[1:]) or False;
     62          prbot_class  = 'prbot with-context' if pr_comment or change.fields else 'prbot without-context';
     63        ">
    6364  <h3 class="change chat-bot ${prbot_class}">
    6465    <span class="avatar">
Note: See TracChangeset for help on using the changeset viewer.