Understood. I think we will need to create a very simple plugin to
accommodate this, as there may be others who want to have sections of
their site devoted to any kind of code.  Here's some first thoughts:

1). We can fix the line breaking problem very easily, by simply
commenting out line 134 in commands.php

//      $value = str_replace('\n', "\n", $value);

All we need is some trigger to turn that off.  We could do a
site.config value like editlines: false but that makes it site wide.
Another option is to use a special syntax in the command itself like
[session edit_lines '.....'] which would function differently from
[session edit_nolines '.....'].  A third option is to have the edit
function look for a separate form command like editlines=false, to
disable. This could make it work as needed from form to form. I prefer
this last option and currently have changed the line above to the
following in the core for the next release, plus added $BOLTarray to
the function globals of course.

        if ($BOLTarray['editlines'] !== 'false') $value = str_replace('\n',
"\n", $value);

There would be merit in turning this behavior off, and require a
special marker to enable it, but that would change the default
behavior and could potentially disrupt existing sites. On the other
hand, I'm also thinking of adding a new command (like template or fmt)
which could be used to generate structured input for a rather special
project I've been working on. That would perhaps be a better
alternative than the approach of trying to construct complex page
layouts using a bunch of \n, and make the existing behavior even less
essential. That is, in specialized form you would enable rather than
disable by setting editlines to true....

I'm tinkering with the possibilities--just thinking out loud (as I
tend to do). But also want to do it the best way possible. And if
possible avoid breaking existing sites. I'll give you something
definite in the next release. For now just patch the line in the edit
command as suggested above.

2) As for the /*comment*/ issue, that can be preserved easily enough
by changing the order of the markup table by moving the pre>comments
rule to follow the pre>boxes rule. See markups.php. And that might be
a good idea in some ways.  After trying to think of ways this change
would affect existing sites, I had to conclude your situation is
probably much more common and more important than anything I can think
of.

The one small issue I can envision is trying to put actual comments
into a code div, in but why would you hide stuff in a code snippet you
are TRYING to display in a page?  And to get the current effect of

<code>test/*hide*/test</code>

we would only have to do

<code>test</code>/*hide*/<code>test</code>.

Kludgy, but probably would never be an issue. We could switch the
order using a plugin, but I think it might be best to change the core,
unless someone can suggest a reason for not doing so...

3). To disable a markup rule (like ----) just do in a config file:

MarkUp('style', 'hr', '');

Actually, I'm going to change the markup function in engine.php so you
don't have to supply the third blank parameter.  Similarly, to change
the order of the markup table to escape comments when in <code> it
would take two lines:

MarkUp('pre', 'comments', '');  // Disable current rule
MarkUp('pre', 'comments2', '/\/\*(.*?)\*\/([^\/]|$)/s', '');  // Re
add, but to end of "pre" rules...

To disable these in just a forum group for example, you might put them
in config.forum.php. They will only take place in the forum hierarchy
and not affect the rest of the site.  Of course you can just manually
move the pre>comments line to just after the pre>boxes line. I'm
planning to do that in the next release.  How's that for service!   :)

Cheers,
Dan

--~--~---------~--~----~------------~-------~--~----~
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