Q: What are the rules for using [...]? How does one
escape from the
Smalltalk block interpretation if that is needed?
use \[ and \] to escape the
block-characters. Generally the backslash
can be used to escape any of the wiki tokens like \*, \+, \=, ...
Yes, that works but the escape will be eaten just like what happens
with the <> vs. < and > when you edit the page again.
I can't reproduce eaten \* with the latest SmallWiki 1 engine.
In Safari it is possible to fix the eaten > and < by double
escaping the contents of textareas. However I don't know and I don't
have the time right now to test, if there are any unwanted
side-effects. Tell me if the following code is of any help?
HtmlTextArea>>textAreaWithValue: aString callback: aBlock
self attributeAt: 'name' put: (self registerFormCallback: aBlock).
self
tag: 'textarea'
do: [
self
encode: (self
encode: aString
with: self attributeEscapeTable
on: self)
with: self attributeEscapeTable
on: self ]
keepTight: true.
Not knowing the least bit about Smallwiki I wonder how
this effect
happens in the first place - considering that it does happen with all
browsers I tried and that it does happen both for tags as well as
backslash escapes it seems as if there is a problem in the way
Smallwiki stores the data. If Smallwiki stores the "raw" (escaped)
data this shouldn't happen, but even if it stores the actual
characters escaping those for editing should not be a big issue.
SmallWiki stores a parsed tree of objects representing the page, there
is no escaped data in there. Meaning that having a document
hello
> and \*
*bla*
gives something like
Document new
add: (Paragraph new
Text with: 'hello';
yourself);
add: (Paragraph new
Text with: '> and *';
yourself);
add: (Paragraph new
InternalLink with: 'bla';
yourself);
yourself.
Note that the * are saved as plain string, changing the parser and
visitor allows to implement a different wiki-syntax without modifying
the model.
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch