Yes, I've noticed that as well. And it has aggravated me at times, but
not sufficiently to do something to try and fix it.

It seems to be a problem/feature of how html works. If you create a
page, save   to it and save. It will be saved unchanged in the
source.  If you edit it, and look at the html source of the output
page, it is still there inside the text box--but the text box displays
it as a regular space. Which is what BoltWire gets back when the form
is submitted the second time. I'm guessing we need to somehow escape
this in the form markup inputs. For the box function, it would require
a tweak to the source function.

This feature of html works nicely for < which is automatically escaped
in the actual page source for security reasons, and a few other
problematic characters like $ and the like. So we have to be selective
in this. I don't know if it's easier to escape everything, then
reverse the few special characters we want invisibly escaped. Or just
unescape the few characters that irritate us. Like spaces.

One quick fix is to change 580 from

        $out = str_replace(Array('<', '[messages]', '[results]'),
Array('&lt;', '&#91;messages&#93;', '&#91;results&#93;'), $out);

to

        $out = str_replace(Array('<', '[messages]', '[results]', '&nbsp;'),
Array('&lt;', '&#91;messages&#93;', '&#91;results&#93;',
'&amp;nbsp;'), $out);

To get this to work for other form inputs, you would want to put this
line in markups.php ~395, just before the $args['js'] flag.

        $args['value'] = str_replace('&nbsp;', '&amp;nbsp;', $args['value']);
        if (isset($args['js'])) {

As these two fixes seem to play nice together, I'll temporarily put
these in the code for the next release, but note it is a patch that
only partially solves the problem. On the other hand, this is about
the only character I've ever had issues with here, so it may be
adequate. If it becomes more problematic elsewhere we could make it a
configurable array--or try some other more systematic approach. We
just have to be careful about conflicting issues. But I think we have
the key locations spotted at least.

Cheers,
Dan


On Wed, Oct 7, 2009 at 7:24 AM, Hans <[email protected]> wrote:
>
> When I insert HTML entities into a page, like &nbsp;, and save the page,
> the page source shows that the entity code is lost and decoded instead.
> I find that quite unnerving. How can i preserve entities in the page source,
> so that they only get decoded by the browser displaying the page?
>
> thanks,
> Hans
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to