eZ Community » Forums » Setup & design » Space after link in content area
expandshrink

Space after link in content area

Space after link in content area

Saturday 27 March 2010 12:24:58 pm - 11 replies

I'm getting a space inserted into my content between link content and following punctuation:

In edit mode I get

 <link>blah</link>, blah blah

and in the site I get

 <a href="#">blah</a> , blah blah

Looking in template debug indicates that the space isn't being created by the link template - so what's causing it?

Saturday 27 March 2010 7:41:03 pm

Hi Paul,

What version are you using, of eZ? I just tested this in an almost clean eZ 4.2 with sample data, added a link with the editor and it looks okay to me.

Regards Robin

Saturday 27 March 2010 11:28:50 pm

Hi Robin,

The site in question is running 4.2, but I've just tested it on a virgin copy running 4.3.0beta2 (running ezflow) and I'm getting the same problem.

To duplicate add, with editor disabled, something like

<link href="eznode://2">Here's my link</link>, and here's some other text.

and you get (how <b>do</b> you break out of literal in this thing?):

<a href="#">Here's my link</a> , and here's some other text.

Modified on Sunday 28 March 2010 5:03:52 am by paul bolger

Sunday 28 March 2010 9:41:28 pm

Hi Paul,

I've been playing with this, trying to trace the issue. I can confirm this is a problem in 4.3.0. If I look at the debug, the standard template files paragraph.tpl and link.tpl output this code but they look okay.

It does look like a bug though, can you file this on the issue tracker?

Thanks Robin

Monday 29 March 2010 1:46:27 pm

Thanks Robin,

Issue filed. I've checked paragraph.tpl and link.tpl too, with no luck.

Paul

Wednesday 14 April 2010 8:26:31 pm

We had the same problem and could not see a problem with link.tpl in a Linux text editor. We even did some investigation into the ezxmloutput handler but could not find a problem. However, in a Windows text editor there was a blank second link in link.tpl. We removed the blank second line in the Windows text editor and the problem is gone.

We moved on after 10 minutes of trying to get the Linux text editor to display that blank second line. Are there any line break gurus around?

Modified on Wednesday 14 April 2010 8:28:04 pm by Peter Keung

Thursday 15 April 2010 5:42:07 pm

Hi,

I had the same problems because of the behaviour of vim that adds an EOL char at the end of the last line of every file.

See http://pwet.fr/blog/le_bug_de_l_espace_supplementaire (in french) or http://translate.google.fr/translate?u=http://pwet.fr/blog/le_bug_de_l_espace_supplementaire&sl=fr&tl=en&hl=&ie=UTF-8

Monday 27 September 2010 11:57:29 am

Hi

I'm having this same problem with the space after my links, I've followed the above link but not really understanding it.

I'm guessing "VIM" is an extansion of some sort but i don't now where it is or how to edit it.

Hope you can help

Thanks

Monday 27 September 2010 1:34:41 pm

Vim is a text editor.

What you'll have to do is go to whatever template is displaying the link - i.e. design/standard/templates/content/datatype/view/ezurl.tpl

What is happening is that there is an extra line added to the template that is not visible with some text editors - like the vim text editor. This adds the space. You'll have to remove that extra line.

And yeah, I had this happen a while back and the templates going back to 3.9 had the extra line feed (that's where I stopped looking).

Monday 27 September 2010 6:53:19 pm

Hey

Thanks very much for your reply.

I followed your instructions and found the extra line in that tpl but it did not fix the problem. I then had a look at this file "design/standard/templates/content/datatype/view/xmltags/link.tpl" which also had an extra line, i deleted it and it worked fine, thank you for helping me out.

Much appreciated

over & out

Wednesday 07 November 2012 2:28:39 pm

I have similar problem, just disable debug output for fixing.

Tuesday 19 February 2013 1:09:08 am

Yes, template debug can create this problem as well, but turning template debug off is not sufficient if Vim or a similar editor is adding a new line to the end of files.

I use this in my /etc/vimrc file:

 autocmd BufWritePre *.tpl :set binary | set noeol

Of course that will affect every file you edit in Vim, but given that we're creating templates for HTML output, it might be wise anyway; otherwise you can get whitespace in places you may not want it, as can be the case in XML block links as Paul mentioned above.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from