Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Font tags around pasted field text

Anyone have a work around for preventing tags appearing around field text; this problem happens when I paste the text from a text-only Notepad file. I have a template like this:

<span class = "sidebartext">
{$.sidebar$}
</span>

My output looks like this:

<span  class = "copyquote">
<FONT size=2>
<P>This is my sidebar text</P></FONT>
</span>

..and of course those <font> tags alter the style I want. I can deal with the <p> tags in the style sheet, but it's those pesky <font> tags that are the problem. When I type directly into the field rather than paste, the <font> tags don't appear. I've pasted from other text sources and I get the <font> tags every time. 

I read Joel's earlier thread (see Paragraphs and {$.body$} post) about <p> tags only appearing around multi-paragraph text, but that doesn't seem to be the case when I paste - even single lines get them, plus the <font> tags.

Any suggestions for suppressing the <font> tags, or prep'ing my text better so it is truly unformatted and doesn't trigger the <font> tags when I paste into the field?

chasInNapa
Tuesday, June 10, 2003

Edit > Paste Without Formatting?

Joel Spolsky
Tuesday, June 10, 2003

I never have to "paste without formatting" from Notepad.

Sometimes I miss a step: I copy from the source and paste into Notepad, forget to copy from Notepad, then past into the article (so I'm actually pasting the format junk from the orginal source).

After I panic, I realize I forgot to copy from Notepad. I make this mistake nearly every day.

tk
Tuesday, June 10, 2003

Thanks for the replies. The Paste Without Formatting worked. I didn't know that option existed.

Also, this might be documented somewhere, but found once I pasted into the field and got those font tags associated with it, it was hard to get rid of them, even if I deleted the text and left it blank or I typed text in later. thoose font tags were still in thee code.

Here's how to get rid of them; clear the text from the field and then select from left to right as if to select a single character and you are able to make a very small selection. Delete once, the selection disappear, delete again and the insertion point marker jumps back to normal size. No more font tags.

chasInNapa
Wednesday, June 11, 2003

*  Recent Topics

*  Fog Creek Home