[wp-trac] [WordPress Trac] #23756: make_clickable should not convert the URLs in pre, code tags

WordPress Trac noreply at wordpress.org
Wed Aug 14 19:14:50 UTC 2013


#23756: make_clickable should not convert the URLs in pre,code tags
------------------------------------------------------+--------------------
 Reporter:  alex-ye                                   |       Owner:
     Type:  defect (bug)                              |      Status:  new
 Priority:  normal                                    |   Milestone:  3.7
Component:  Formatting                                |     Version:  3.5.1
 Severity:  normal                                    |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-tests  |
------------------------------------------------------+--------------------

Comment (by adamsilverstein):

 Replying to [comment:13 helen]:
 > I WROTE A UNIT TEST YOU GUYS. [attachment:23756.test.diff]
 >
 > Looking at jjj's patch, it seemed to me that nesting them would break
 things, as in it would end the $in_code flag early, which does seem to be
 the case. The last test fails; however, I'm not sure that you're supposed
 to have a `code` element inside `pre` unless it wraps everything as well,
 e.g. `<pre><code>blah</code></pre>`. See http://www.w3.org/TR/html5
 /grouping-content.html#the-pre-element

 your unit test looks good to me. i added a nested level count in
 [attachment: 23756.2.diff​] and your test now passes! not sure pre tag
 surrounding code is right, but it is going to happen, so makes sense to
 account for the possibility. even in the w3.org page you linked they have
 nested that way in their sample code. http://cl.ly/Qp6K

--
Ticket URL: <http://core.trac.wordpress.org/ticket/23756#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list