Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Bug with links containing "&"?
icon5.gif  Bug with links containing "&"? [message #500056] Tue, 24 November 2009 19:47 Go to next message
Karsten Wutzke is currently offline Karsten Wutzke
Messages: 112
Registered: July 2009
Senior Member
Hello,

when editing HTML files, I have href links like

href="http://books.google.com/books?id=tIQ4CqmJ9e0C&amp ;pg=PA75&lpg=PA75&dq=sql+%22multiple+inherit ance%22&source=bl&ots=IFRtMaansm&sig =7YbSvCHDUjsAX_InmLki1wmwVrs&hl=de&ei=_QnWSt iiGs7-_Aaiq4jZAg&sa=X&oi=book_result&amp ;ct=result&resnum=10&ved=0CDIQ6AEwCQ#v=onepa ge&q=sql%20%22multiple20inheritance%22&f=fal se "

As you can see they contain many "&" 's (to get past the XHTML validator). However, when Ctrl-clicking the links from the web editor, the google books page isn't shown, just some fallback page to the book in general.

This seems to happen because the "&"s aren't decoded. I can see the "&"s in my URL line in the browser (Firefox 3). When clicking the link inside a browser, the link is OK, because it gets decoded.

Is this a bug? Does it already exist?

Karsten
Re: Bug with links containing "&"? [message #500087 is a reply to message #500056] Tue, 24 November 2009 21:47 Go to previous messageGo to next message
Nick Sandonato is currently offline Nick Sandonato
Messages: 126
Registered: July 2009
Senior Member
Hi,

I do not think the problem is with the & separators in your URI, but instead with the # found in the value for parameter ved. In particular, # is used as a delimiter for fragment identifiers as stated in the URI RFC [1]. If needed, you can work around this by changing # to %23.

I think our hyperlink detector might be able to do a better job at making sure that it's not trying to send you to a location based on a URI fragment. So please feel free to open a bug.

[1]. http://www.ietf.org/rfc/rfc2396.txt
Re: Bug with links containing "&"? [message #500103 is a reply to message #500087] Tue, 24 November 2009 23:51 Go to previous messageGo to next message
Karsten Wutzke is currently offline Karsten Wutzke
Messages: 112
Registered: July 2009
Senior Member
Hmmm I don't think the # is the problem: when you replace all

&

with

&

in Eclipse and Ctrl-click the link, it works perfectly.

Eclipse just doesn't seem do decode the "&" to just "&" before passing it to the external browser. (I also tested the internal browser, they are equal.)

Karsten
Re: Bug with links containing "&"? [message #501073 is a reply to message #500056] Mon, 30 November 2009 21:57 Go to previous messageGo to next message
David Carver is currently offline David Carver
Messages: 174
Registered: July 2009
Senior Member
I believe this is a bug, it should be decoding those URL's so they are valid. Please open a bug if it's a duplicate somebody will mark it as such.
Re: Bug with links containing "&"? [message #501105 is a reply to message #501073] Tue, 01 December 2009 04:36 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2277
Registered: July 2009
Senior Member
Dave Carver wrote:
> I believe this is a bug, it should be decoding those URL's so they are
> valid. Please open a bug if it's a duplicate somebody will mark it as
> such.

I've always encoded & as "&" in our New and Noteworthy pages
where the link represents a Bugzilla query. Looking at the
in-browser source for
http://www.eclipse.org/webtools/releases/3.1.0/newandnotewor thy/index.php,
the & are encoded there and the link works fine. And I routinely
test those queries by activating the link directly within the XML
Editor, where it also works fine.

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Bug with links containing "&"? [message #501289 is a reply to message #501105] Tue, 01 December 2009 18:31 Go to previous message
Nick Sandonato is currently offline Nick Sandonato
Messages: 126
Registered: July 2009
Senior Member
It looks like Karsten opened a bug already https://bugs.eclipse.org/bugs/show_bug.cgi?id=296069

Nitin, I don't think you'll see this problem in the XML editor because I think it's the Anchor hyperlink detector causing the problem since it specifically looks for references with # in them to try and locate an id/name in a file with the fragment after the #.
Previous Topic:Sometimes web project fails to compile - missing tomcat runtime libraries
Next Topic:Embedding XMLEditor in multipageditor
Goto Forum:
  


Current Time: Tue Sep 23 10:22:57 GMT 2014

Powered by FUDForum. Page generated in 0.03674 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software