WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#23756 new defect (bug)

make_clickable should not convert the URLs in pre,code tags

Reported by: alex-ye Owned by:
Priority: normal Milestone: Awaiting Review
Component: Formatting Version: 3.5.1
Severity: normal Keywords: needs-patch
Cc: nashwan.doaqan@…

Description

Hi , Maybe it's a duplicate ticket but I tried to search in history.

Anyway , The purpose of this ticket is to have a clean snippet code posts .. for now it's hard to do it by plug-in .. and many people remove make_clickable filter at all !

So let's make it possible in 3.6 :)

Attachments (1)

23756.patch (701 bytes) - added by johnjamesjacoby 4 weeks ago.
Skip links in code and pre blocks.

Download all attachments as: .zip

Change History (9)

comment:1 alex-ye3 months ago

  • Cc nashwan.doaqan@… added

and who will say that I must escape the URLs before posting them so the make_clickable won't work , It's really hard and dirty solution !!

Many users don't do that and many users facing problems !! , I think we should not convert the URLs in pre,code tags at all !! , or at least make it easy by some hooks :)

comment:2 alex-ye3 months ago

  • Version set to 3.5.1

comment:3 follow-up: alexvorn23 months ago

does this function is used when displaying the post? -> the_content()

Last edited 3 months ago by alexvorn2 (previous) (diff)

comment:4 in reply to: ↑ 3 ; follow-up: alex-ye3 months ago

Replying to alexvorn2:

does this function is used when displaying the post? -> the_content()

Yes

comment:5 in reply to: ↑ 4 ; follow-up: SergeyBiryukov3 months ago

Replying to alex-ye:

Replying to alexvorn2:

does this function is used when displaying the post? -> the_content()

Yes

No, it isn't: #18214.

The purpose of this ticket is to have a clean snippet code posts

make_clickable() is only applied to comment_text() by default:
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/default-filters.php#L151

comment:6 follow-up: SergeyBiryukov3 months ago

Making it skip <pre> and <code> tags might still be a good idea though, if it doesn't have a noticeable effect on performance.

comment:7 in reply to: ↑ 5 alex-ye3 months ago

Replying to SergeyBiryukov:

No, it isn't: #18214.

Thank you for correction , I make sure that a plugin who adds the make_clickable to the_content filter ..

comment:8 in reply to: ↑ 6 alex-ye3 months ago

Replying to SergeyBiryukov:

Making it skip <pre> and <code> tags might still be a good idea though, if it doesn't have a noticeable effect on performance.

Yes , I face problems in comments or topics/replies also in bbPress , I made my own hack to fix this but I think it is something the core should do .

The bug be bigger when you use a Syntax Highlighter plugins .

johnjamesjacoby4 weeks ago

Skip links in code and pre blocks.

Note: See TracTickets for help on using tickets.