Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-01-06 21:55:12

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Preview oddity w/ numeric character entities

Just noticed an oddity fwiw.

If you use a numeric character entity, say & for an ampersand, and click on preview, the preview post will show the numeric code, but the text edit box will have translated the code to an “&”.

Offline

#2 2011-01-06 22:57:27

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Preview oddity w/ numeric character entities

maverick wrote:

Just noticed an oddity fwiw.

If you use a numeric character entity, say & for an ampersand, and click on preview, the preview post will show the numeric code, but the text edit box will have translated the code to an “&”.

I assume you mean on this forum? Displaying these entities is a disaster, even if I use

@"@

or

=="==

they get lost in the preview, and most of the time in the post as well… lost it in your quote too. If someone knows a way how to do it properly, I’ll be very grateful!

Offline

#3 2011-01-06 23:19:05

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Preview oddity w/ numeric character entities

Els wrote:

I assume you mean on this forum? Displaying these entities is a disaster …. they get lost in the preview, and most of the time in the post as well… lost it in your quote too. If someone knows a way how to do it properly, I’ll be very grateful!

Sorry Els – I should have been more clear. Your are right – I meant here on the forums.

I would have thought textile would work it the other way around — that if I typed in the code it would display the proper character in the post/preview and IF it was going to retain the the code it would be in the editing portion.

But then, I don’t always want the code to be translated. Sometimes I want to communicate the code.

Especially when previewing. If I wanted to actually post the code in my message, and I want to preview it, I don’t want to have to change the character back to the code every time I preview.

Not really a complaint per say. Just odd how it works. Not as one might expect.

For the sake of learning – if there is a proper way, I’m now curious. :)

Last edited by maverick (2011-01-06 23:20:18)

Offline

#4 2011-01-06 23:59:46

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Preview oddity w/ numeric character entities

PunBB doesn’t do proper escaping to the content that is shown in the message field. That’s why you lose entities when editing, quoting or previewing a post; the characters are shown as is, without escaping.

Offline

#5 2011-01-07 00:17:38

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Preview oddity w/ numeric character entities

Thanks Jukka

Offline

#6 2011-01-07 00:28:40

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Preview oddity w/ numeric character entities

maverick wrote:

Thanks Jukka

+1 :)

Offline

#7 2011-01-07 00:48:58

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Preview oddity w/ numeric character entities

Heh, you’re welcome Els and Mike :-)

Offline

Board footer

Powered by FluxBB