I'm writing a tiddlyWiki parser as part of an exercise try and
understand how the tiddlyWiki works.
I have a few questions:
1) What is a wikiword?- I can find no definition. Where is the
definitive definition?
My tiddly wiki seems to think that UTF-8 is a wikiword (since it's
written ~UTF-8) - my parser
finds a ~ then expects a wikiword but UTF-8 is not by the definitions
I have found a wikiword
ie its not CamelCase.
2) What is escaped text. As in """ escaped text """
Is there any difference between """ ... """ (three consecutive double
quotes) and {{{ ... }}}
3) What is supposed to happen when markup elements are incorrectly nested?
I tried a tiddly page containing this:
* --abc//def--hij//
* ghi
* 123
In the first line the strike and italic markup are incorrectly nested.
I had expected this to result in a list, with the first line
being <strike>abc<i>def</strike></i> (Yes I know this is badly formed
XHTML - but
most browser will render this as you might expect, ie:
ie with "abc" in normal struck through text
"def" in italic struck through text
"hij" in italic text
I also expect the second and third lines to have the same indent as
the top line with
no text annotations. Even though the markup in line one is incorrect,
they "cancel out"
by the end of the line.
This example does not behave as expected. The second in third lines
gain an extra level of
indent, and are struck through.
Now there is no notion of "incorrect markup" ie parsing cannot fail
with a syntax error (or can it?)
unfortunately what is "sensable" in the event of badly nested markup
is debatable. This bodes
ill for standardization and wide scale adoption.
In most html parsers an incorrect markup does not propagate beyond the
scope of the
current block (given some definition of a block)
Consider this:
* abc//def
* ghi//
* 123
The result is weird this generates three levels of list indents - all italic
In my mind all "open" markup should be closed at the end of each superior block.
ie additional closing elements should be applied at the end of each
list element, ie this should be
parsed as if it had been defined
* abc//def//
* ghi////
* 123
(aside this strategy could be used to ix up the problem in the origonal example
* --abc//def--hij//
* ghi
* 123
The first line would be transformed to
* --abc//def//--hij////
ie when the second -- is encountered it is a closing occurrence of --
but the currently open element is // so we insert an additional //
*before* the --
Comments: 1) this yeilds well-formed XHTML 2) a bit more work could make this
well-formed and retain what I "expected"
Cheers
/Joe
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" 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/tiddlywikidev?hl=en.