#3998 closed defect (bug) (reported-upstream)
Support Forums: Incorrect link conversion
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Support Forums | Keywords: | |
Cc: |
Description
<a href="https://codex.wordpress.org/Roles and Capabilities">https://codex.wordpress.org/Roles and Capabilities</a>
turns into:
<a href="https://codex.wordpress.org/Roles and Capabilities" rel="nofollow"></a><a href="https://codex.wordpress.org/Roles" rel="nofollow">https://codex.wordpress.org/Roles</a> and Capabilities
Looks like either make_clickable()
or bbp_make_clickable()
is trying to make the URL clickable without taking the existing <a>
tag into account.
Change History (3)
Note: See
TracTickets for help on using
tickets.
This is a problem in
bbp_make_clickable()
, but is also present inmake_clickable()
.Given the input string of
<a href="https://codex.wordpress.org/Roles and Capabilities">https://codex.wordpress.org/Roles and Capabilities</a>
both will return the invalid output.Both contain the following to correct it:
But as the resulting HTML is the following it's not matched (due to the
</a></a>
- which assumes that neither the linked text never has spaces or isn't a URL)Adjusting the regular expression to the following does work however:
As a work around, you can remove the spaces from the linked text, which avoids it:
<a href="https://codex.wordpress.org/Roles and Capabilities">https://codex.wordpress.org/Roles and Capabilities</a>
.I'm going to call this a bug in WordPress and bbPress.
Closing in favour of https://bbpress.trac.wordpress.org/ticket/3237 & https://core.trac.wordpress.org/ticket/45702