Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

BUG: Template editor trips over single quotes

I made a template for pages that shouldn't get published. In HTML view I typed this:
<!-- dummy template for files that shouldn't get published -->

Clicked Normal view then HTML view again, and to my surprise the source had changed to this:
My comment gone, and for some strange reason the closing tags had been changed to upper case...

Playing with it some more showed that the single quote in the comment is the problem. Leaving out the single quote or adding a second directly after solved the problem.

Saturday, September 6, 2003

I've an article that I include in every script as a header. It starts with

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>{$.siteName$}{$ if nonBlank .headline $} - {$ .headline $}{$ endIf $}</title>
    <link rel="stylesheet" type="text/css" href="PTMFOG0000000015.css" title="default" media="screen" />
    <link rel="stylesheet" type="text/css" href="PTMFOG0000000177.css" title="default" media="print" />

<body style="COLOR: black; BACKGROUND-COLOR: white" topmargin=3 leftmargin=3 bottommargin=3 rightmargin=3>

{$ setDateTimeFormat "*" "dd/MM/yy" "HH:mm" $}

If I edit this article and switch to HTML mode and back, all code has disappeared apart from the last line.  NB My site does NOT look pretty without style sheets, to put it mildly.

Saturday, September 6, 2003

Are you saying that you enter the above code while in normal view? If so then you need to enter it in html view to begin with, then never switch that article to normal view.

Ron Lane
Saturday, September 6, 2003

Ron, if that question is directed at me, I enter the code in HTML view.

And it would be real nice if it didn't disappear just because someone switches to Normal view.

Saturday, September 6, 2003

Vic, if you remove the second string in the DOCTYPE tag you're fine. So just put
at the top of your document.

What is the second bit for anyway?

Saturday, September 6, 2003

Dug, thanks, I had taken over the first part of the header from a template. 

And no, if I take the additional strings out CD still gets rid of the CSS references upon switching to Normal View...

Sunday, September 7, 2003

I know you would like to be able to switch between norman and html views, but, from reading these forums it looks like that if you enter anything from the html view you need to not switch to normal view. That may get fixed in the future but, as we speak don't switch from html to normal, thats not always true vice versa.

Ron Lane
Sunday, September 7, 2003

I had to solve this by using a variable, then I do an include of that variable in all of my templates.  Then the stuff in the header are not stripped out.
This may not be applicable for your situation.

Jeff Tulley
Monday, September 8, 2003

Going back to the original problem: CityDesk Template editor trips over HTML Comments containing single quotes.
Anyone at Fog Creek listening?

Friday, September 12, 2003

*  Recent Topics

*  Fog Creek Home