Encoding numeric entities doesn't work

salvis - December 3, 2007 - 21:43
Project:Code Filter
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

It is quite difficult to get the following string to display, at least on FF2/Win:

&​#039;test&​#039;

If you naively write &​#039;test&​#039;, you'll get 'test', which is correct.

If you write &​amp;#039;test&​amp;#039;, you'll get 'test' as well...
(don't use copy&paste, write it yourself!!!)

The behavior is different if you try it within <code>:

If you naively write &​#039;test&​#039;, you'll still get 'test'

But if you write &​amp;#039;test&​amp;#039;, you'll get &amp;#039;test&amp;#039; !
(again don't use copy&paste, write it yourself!!!)

Both outside and inside <code>, Project just doesn't want to render the character sequence
& # 0 3 9 ;
(without the spaces)! I'm not sure whether my browser is part of the problem or not, so I'm attaching a screenshot of my preview display.

If you want to have some fun, you can try copy&paste, and you may find that it magically works
:-)

With IE6/Win you'll see that I've used some magic characters (showing up as unprintable boxes) to force Project into showing the strings which I claim can't be shown.

AttachmentSize
numeric-entities.png27.19 KB
numeric-entities-IE6.png28.56 KB

#1

dww - December 3, 2007 - 21:48
Status:active» postponed (maintainer needs more info)

I don't understand why this has anything to do with the project.module. Can you please clarify? Sounds more like an issue for core at first glance...

#2

salvis - December 3, 2007 - 22:56

You've got a point. The reason why I came to project.module is that this started out as a problem I had inside <code> in an issue queue, and that's where it really bothers me. AFAIK the filter that processes <code> and <?php> here on d.o not in core.

When I wrote my post, I started experimenting and found out that the opposite effect was happening in plain text. I've just verified that the core Filtered HTML input filter does the same thing to plain text, but it treats <code> in the same way as plain text.

So, I guess it would be desirable to fix the plain text issue in core, but it's much more important to fix the <code> issue in project.module, because it gets into the way when trying to post code or error messages with numeric entities.

#3

salvis - December 3, 2007 - 22:59
Status:postponed (maintainer needs more info)» active

BTW, <?php> behaves the same as <code>.

#4

dww - December 3, 2007 - 23:24
Project:Project» Code Filter
Version:5.x-1.x-dev» 5.x-1.x-dev
Component:Miscellaneous» Code

<code> is from the Code Filter module. Moving to the right queue.

#5

salvis - December 4, 2007 - 00:22

Thanks, I didn't realize this was a separate module.

 
 

Drupal is a registered trademark of Dries Buytaert.