[TYPO3] Typolink parsing links incorrectly

Christopher Torgalson bedlamhotel at gmail.com
Fri Feb 23 22:45:49 CET 2007


Hi,

On 2/23/07, Bernd Wilke <xoonsji02 at sneakemail.com> wrote:
> On Fri, 23 Feb 2007 17:17:40 +0100, Florian Schaeffer wrote
> with subject "Re: [TYPO3] Typolink parsing links incorrectly":
>
> > Hello Sara,
> >
> > > Typo3 has (for the last day or so) started changing links (added through
> > > 'make link' using htmlareaRTE)
> > >
> > > from
> > > index.php?id=61&L=1 to ?id=61&amp;L=1
> > >
> > > Does anyone know which TSObject lib I need to change to stop it changing
> > > the & to &amp;
> > >
> > > Its something to do with the htmlspecialchars property I assume.
> >
> > actually this is the correct behaviour to be XHTML compliant, as a &
> > must be escaped in XHTML by &amp;
> > Every browser is fine with this, so nothing to worry about....
>
> caveeat: Javascript doesn't like it!
> for every URL used in Javascript you must translate it back.


That's odd. I've never seen any problems with html entities in js. For
example, in the following sample, js both displays the link correctly
and follows it to the correct location:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>JS Link Test</title>
	<script type="text/javascript">
		function readAndRelocate(id) {
			var testLinkLocation = document.getElementById(id).href;
			var decision = confirm("Follow the link?\n[" + testLinkLocation + "]");
			
			if (decision) {
				window.location = testLinkLocation;
			} else {
				return;
			}
		}
		
		window.onload = function() {
			readAndRelocate('foo');
		}
	</script>
</head>
<body>
	<p><a href="http://www.google.ca/search?hl=en&amp;q=typolink&amp;btnG=Search&amp;meta="
id="foo">Search for typolink</a></p>
</body>
</html>


Can you elaborate about the problems you're referring to?

-- 
Christopher Torgalson


More information about the TYPO3-english mailing list