• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item5939: Rogue <p /> below </html> on every topic in every web

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Urgent Closed   patch 4.3.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

I first noticed this problem on my stock 4.2.1 installation. Doing a "View Source" on any topic of any web results in the following at the very bottom:
 
</body></html>
<p />

This, of course, doesn't validate as valid XHTML. I used the provided 4.2.1 -> 4.2.2 patch file (from the 4.2.2 comments page) to upgrade to 4.2.2. Now my installation says:

This site is running TWiki version *TWiki-4.2.2, Wed, 06 Aug 2008, build 17396*, Plugin API version *1.2*

but the problem is still present on every topic of every web. I have looked at every .tmpl file that defines "bodyend", but did not see the rogue <p /> in any definition ... leading me to believe that it is a bug in code somewhere (?).

-- TWiki:Main/MichaelRubin - 18 Aug 2008

This is also showing on http://twiki.net static html pages. They were probably generated from TWiki topic using some publish plug-in.

-- TWiki:Main.StephaneLenclud - 18 Aug 2008

No it is a real bug also in a naked 4.2.2. I am trying to analyse it now. There is no /p in the templates that define /html.

-- TWiki:Main.KennethLavrsen - 18 Aug 2008

I have the fix ready.

Checking in

-- TWiki:Main.KennethLavrsen - 18 Aug 2008

If we had a tool to detect those newlines at the end of templates...

-- TWiki:Main.ArthurClemens - 18 Aug 2008

checked in a fix which is to remove the empty line at the end of twiki.tmpl

Anyone can fix their current TWiki by simply deleting the empty line at the end so the last line reads %TMPL:P{"bodyend"}%

-- TWiki:Main.KennethLavrsen - 18 Aug 2008

I fixed my twiki.tmpl on a Windows installation a few days ago and it did the trick (I had used the ZIP file). Now I used the GZ file to setup a Linux installation and I still have that problem after checking and checking again twiki.tmpl with various text editor.

-- TWiki:Main.StephaneLenclud - 22 Aug 2008

I have confirmed the fix on 3 Linux machines now and other have too.

One thing that was noted is that an editor like nano seems to add the new line character at the end of the file by default so you may need to try a different editor.

-- TWiki:Main.KennethLavrsen - 22 Aug 2008

As text files not ending by a newline have historically been causing bugs in most unix tools (/etc/passwd, hosts, crontab, ...) for a long time, most unix/linux editors add an ending newline. So this is bound to happen again. And will bite anyone who makes a twiki.myskin.tmpl for his new skin. Maybe we should introduce a feature to expliciitely ignore the last newline? (\ before last newline? an optional explicit %EOF% to force the end of file?). Or have the template loading function ignore the last newline? Or better, all the routines emitting an XHTML document should trim the ending newlines (or P tags?) before sending the (x)html ?

-- TWiki:Main.ColasNahaboo - 23 Aug 2008

I tried nano, gedit and vi without luck. Any editor you recommend? vi does not even show the last new line character.

-- TWiki:Main.StephaneLenclud - 24 Aug 2008

Emacs and XEmacs by default prompt you for what to do if you save a file without a termianting newline. This is the variable require-final-newline. See http://www.delorie.com/gnu/docs/emacs/emacs_113.html

-- TWiki:Main.ColasNahaboo - 26 Aug 2008

I downloaded the file, opend it with Notepad++ removed the empty line, uploaded and the < / p > doesn't show up anymore. In this case being not that clever with linux is supposed to be something good wink

-- TWiki:Main.CarloSchulz - 27 Aug 2008

ItemTemplate
Summary Rogue <p /> below </html> on every topic in every web
ReportedBy TWiki:Main.MichaelRubin
Codebase 4.2.1, 4.2.2
SVN Range TWiki-5.0.0, Mon, 11 Aug 2008, build 17408
AppliesTo Engine
Component

Priority Urgent
CurrentState Closed
WaitingFor

Checkins TWikirev:17428 TWikirev:17429
TargetRelease patch
ReleasedIn 4.3.0
Edit | Attach | Watch | Print version | History: r18 < r17 < r16 < r15 < r14 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r18 - 2009-04-08 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback