Opened 9 months ago

Closed 5 months ago

#1932 closed defect (duplicate)

Anchors that include URL's w/ other text & spaces get formatted incorrectly

Reported by: netweb Owned by:
Priority: normal Milestone:
Component: Content Creation Version: 2.1
Severity: normal Keywords:
Cc:

Description (last modified by johnjamesjacoby)

If an anchor's text begins with 'http://' and includes whitespace bbPress rendering output is invalid.

Example:

<a href="http://forums.whirlpool.net.au/forum-replies.cfm?t=1171893">http://forums.whirlpool.net.au/forum-re ... ?t=1171893</a>
<a href="http://example.com">http://example.com http with title html whitespace</a>

bbPress HTML Current Output:

http://forums.whirlpool.net.au/forum-re ... ?t=1171893

http://example.com http with title html whitespace

bbPress HTML Expected Output:

http://forums.whirlpool.net.au/forum-re ... ?t=1171893

http://example.com http with title html whitespace whitespace

If you use the same code in a standard WordPress POST all HTML rendering/output IS correct, this is only a bbPress issue.

Hat Tip @capsx for finding this

Change History (6)

  • Milestone changed from Awaiting Review to 2.1.3
  • Milestone changed from 2.1.3 to 2.2

Confirmed, but it's probably important to note that WordPress comments exhibit this same behavior.

Moving to 2.2, since it's indicative of a larger issue, and won't be fixed in the short term for 2.1.3.

Related info:

http://core.trac.wordpress.org/browser/tests/trunk/tests/formatting/MakeClickable.php#L308

'Some text with a link <a href="http://example.com">http://example.com</a>',
//'<a href="http://wordpress.org">This is already a link www.wordpress.org</a>', // fails in 3.3.1 too

http://core.trac.wordpress.org/browser/trunk/wp-includes/formatting.php#L1622

// Cleanup of accidental links within links
$r = preg_replace( '#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );

http://core.trac.wordpress.org/browser/trunk/wp-includes/default-filters.php#L151

add_filter( 'comment_text', 'make_clickable',      9 );
  • Milestone changed from 2.3 to Future Release

I'm inclined to close this, since all signs point to this being an issue in WordPress core.

Moving to Future Release for now.

  • Description modified (diff)
  • Summary changed from HTML HREF TITLE Element Rendering to Anchors that include URL's w/ other text & spaces get formatted incorrectly
  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Closing. See: #WP23050.

Note: See TracTickets for help on using tickets.