Sorry about these. There are reasons for both... But one big thing to
keep in mind, is the <code> function is primarily designed to display
markup code. It may not be ideal for php code, which could have a few
differences, like the first one.
1) In the first example, \n is automatically converted to an actual
line break when a page is edited. This is very handy when you want
something like:
[text title]
[box content][box]
[session edit "{=title}\n\n{=content}\n\nsome footer stuff"]
This would be impossible otherwise. There is a workaround however,
and that is to change \n to \`n. Then it will display in your code
function. The other option is to manual edit the source page and
return the line break to \n--but it will revert the next time the page
is edited.
2) The second is a result of the order of processing. /* */ is
processed before <code></code> so it is in fact dropped from the
output before it ever gets to the code function. The solution is to
escape the escape. ie `/* */. That breaks the pattern and will allow
the full code to be displayed.
You should not have had the # however, and in my test it didn't show
up. Perhaps that was a typo or something. Also note that anchors
(which can be used to define a template should be
[[#template]]template here[[#whatever]]. Not []. I set up a test page
here:
http://www.boltwire.com/index.php?p=test.code
Cheers,
Dan
P.S. Since these are more features than bugs... It might be possible
to fix this by developing either a custom edit function (maybe
codeedit) which properly escaped these things. Or use the
BOLTreplacetable to do simple string replacements on editing. Seems
that would be easy enough. Let me know if the workarounds are not
adequate and we can look into this more.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---