Empty links

14 views
Skip to first unread message

Tapio

unread,
Nov 27, 2008, 2:36:56 PM11/27/08
to TYPO3 tinymce_rte
Hi

Because editors makes mistakes it is annoying that Typo3 adds the
title of the page into empty a tag
<a href="...10></a>

in Frontend <a href="...10">Title of the page</a> Really annoing as
defaut behavior.
Creating link around image editors might create by accident empty
link.

I don't know how typo3 generates them but if that is hardcoded we
could make an option to disable this behavior.

Is there any config for this?

Peter Klein

unread,
Nov 27, 2008, 3:57:19 PM11/27/08
to typo3-ti...@googlegroups.com

Is the link stored in the DB as <a href="10></a> or as <link 10></link> ?

If it's stored as <a href="10></a> , it might be the parseFunc userfunc that causes it as a side effect when the link is empty..

--
Peter
winmail.dat

Tapio

unread,
Nov 27, 2008, 4:19:14 PM11/27/08
to TYPO3 tinymce_rte


On 27 marras, 22:57, "Peter Klein" <pe...@umloud.dk> wrote:
> Is the link stored in the DB as <a href="10></a> or as <link 10></link> ?

didn't look database - in RTE it was in source code view

<a href="http://safkis.xetnet.com/?id=121"></a>
or
<a href="http://safkis.xetnet.com/?id=121" class="undefined"></a>

> If it's stored as <a href="10></a> , it might be the parseFunc userfunc that causes it as a side effect when the link is empty..

Just how to get rid of this behavior.

Tapio

unread,
Nov 28, 2008, 11:55:25 AM11/28/08
to TYPO3 tinymce_rte

> Just how to get rid of this behavior.
could some check an additional config to add here

class ux_t3lib_parsehtml_proc extends t3lib_parsehtml_proc {

function TS_links_db($value)

if a tag with href or link is empty, remove tags.

Tapio

unread,
Nov 30, 2008, 4:26:28 AM11/30/08
to TYPO3 tinymce_rte
Hi

I'm not familiar with complex replace. Could someone build some code
to take off empty a tags, which have href attribute,
when transforming from rte to db.

That could be added to XCLASS for t3lib/class.t3lib_parsehtml_proc.php

class ux_t3lib_parsehtml_proc extends t3lib_parsehtml_proc {
function TS_links_db($value) {
//some code here

parent::TS_links_db($value);

Peter Klein

unread,
Nov 30, 2008, 6:43:43 AM11/30/08
to typo3-ti...@googlegroups.com

I added a check for empty content in the Typoscript parseFunc, and that seems to work. So try the latest "setupTSConfig.ts" from SVN, and test if it works for you on 4.1 too.

--
Peter

-----Original Message-----
From: typo3-ti...@googlegroups.com on behalf of Tapio
winmail.dat

Tapio

unread,
Nov 30, 2008, 8:19:27 AM11/30/08
to TYPO3 tinymce_rte

"setupTSConfig.ts" from SVN, and test if it works for you on 4.1 too.

Thank's

if that works on 4.2 I don't see any reason why not in 4.1

Tested with an installation, which doesn't have tinymce_rte with this

lib.parseFunc.tags.a = TEXT
lib.parseFunc.tags.a {
current = 1
if.isTrue.current = 1
typolink.parameter.data = parameters : allParams
typolink.ATagParams.data = parameters : allParams
}
lib.parseFunc_RTE.tags.a < lib.parseFunc.tags.a
lib.parseFunc.tags.link.if.isTrue.current = 1
lib.parseFunc_RTE.tags.link.if.isTrue.current = 1

seems to work. Thank's

Tapio

unread,
Nov 30, 2008, 8:21:47 AM11/30/08
to TYPO3 tinymce_rte

> seems to work. Thank's

Not tested with an anchor - <a name="..." id="..."></a> should not
stripped

Tapio

unread,
Nov 30, 2008, 8:30:31 AM11/30/08
to TYPO3 tinymce_rte
strips those too - but this is not a big problem because it is
possible to set for an anhor some text.

Tapio

unread,
Dec 6, 2008, 1:31:37 PM12/6/08
to TYPO3 tinymce_rte

> strips those too - but this is not a big problem because it is
> possible to set for an anhor some text.

Thomas made a bug report about this issue
http://forge.typo3.org/issues/show/2276

Peter Klein

unread,
Dec 6, 2008, 10:04:03 PM12/6/08
to typo3-ti...@googlegroups.com

It was not the stripping of empty links that caused the anchors to disappear, but because normally a tags are not parsed, but when we parse the A tag without a href, it will be removed.

I just added a fix in SVN

---
Peter


-----Original Message-----
From: typo3-ti...@googlegroups.com on behalf of Tapio
Sent: Sat 12/6/2008 19:31
To: TYPO3 tinymce_rte
Subject: Re: Empty links



winmail.dat

daKmoR

unread,
Dec 7, 2008, 2:40:49 AM12/7/08
to TYPO3 tinymce_rte
On Dec 6, 9:04 pm, "Peter Klein" <pe...@umloud.dk> wrote:
> I just added a fix in SVN

works like a charm... thx :)

Tapio

unread,
Dec 7, 2008, 10:19:56 AM12/7/08
to TYPO3 tinymce_rte

> works like a charm... thx :)

Yes. I tested with

<p><a href="index.php?id=48"></a> <a name="koe"></a></p>

Thank's Peter and Thomas- I really needed that for a customer, who
many times created empty links.
Reply all
Reply to author
Forward
0 new messages