[wp-meta] [Making WordPress.org] #2107: Prevent posting 10k lines of logs in replies, recommend Pastebin or GitHub gists

Making WordPress.org noreply at wordpress.org
Mon Mar 29 08:56:21 UTC 2021


#2107: Prevent posting 10k lines of logs in replies, recommend Pastebin or GitHub
gists
----------------------------+-------------------------
 Reporter:  ocean90         |       Owner:  tellyworth
     Type:  enhancement     |      Status:  accepted
 Priority:  low             |   Milestone:  Q1
Component:  Support Forums  |  Resolution:
 Keywords:                  |
----------------------------+-------------------------

Comment (by vladytimy):

 Looking at [https://meta.trac.wordpress.org/changeset/10702 changeset
 10702] I see the intention is to trim  {{{`}}}  off  before wrapping.


 {{{
 "`" + paste.trim().replace(/^`|`$/g, '') + "`" +     // The pasted text,
 trimming ` off it and wrapping with `
 }}}


 Per [https://wordpress.slack.com/archives/C02RQC6RW/p1617003690331200
 Slack discussion ] and testing, trimming  {{{`}}}  off doesn't happen. I
 don't know why it doesn't work as described, but I personally am happy it
 doesn't trim them off - because of custom pre-defs that contain {{{`}}}


 Suggested alternative: check if {{{`}}} exists in the pasted text before
 wrapping and if true, don't wrap.
 Suggested updated condition:


 {{{
         // If no pasted text,  no textarea value or includes ` then skip.
         if ( ! paste.length || ! $val.length || paste.includes("`") ) {
              return;
         }
 }}}


 Or  {{{ paste.indexOf("`") !== -1 }}} instead of {{{includes()}}} for IE
 compatibility

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/2107#comment:23>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list