Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
maven-reporting-impl 2.4
-
None
Description
Consider this input:
{My Text, ftp://host/file.txt} or {My Text, http:/host/file.txt} (typo)
The current output simply be ftp://host/file.txt or http:/host/file.txt but I would expect it to be My Text in both cases.
The problem is burried in the current code:
for ( Iterator<String> it = segments.iterator(); it.hasNext(); ) { String name = it.next(); String href = it.next(); if ( href == null ) { text( name ); } else { if ( getValidHref( href ) != null ) { link( getValidHref( href ), name ); } else { text( href ); } } }
The invalid href would be printed out instead of name. I think the code should read:
for ( Iterator<String> it = segments.iterator(); it.hasNext(); ) { String name = it.next(); String href = it.next(); if ( getValidHref( href ) == null ) { text( name ); } else { link( getValidHref( href ), name ); } }
Produce link if href isn't null and is valid otherwise add name (text) only.
Attachments
Issue Links
- is part of
-
MSHARED-611 Drop any href validation and pass as-is
- Closed
- is related to
-
MSHARED-429 Supposedly invalid URLs are rendered as plain text
- Closed