On Jun 24, 3:15 pm, [email protected] wrote:

I saw purpleater which looks quite promising :)

> My question: Has anyone come up with a good way to post-process this
> HTML so that it can be used as a reasonable DOM (such that paragraphs
> are paragraphs etc).
I did 3 attempts allready. (Your and FNDs code is much more beautiful,
than any of mine :). I couldn't get them to work, without breaking
compatibility to old TiddlyWiki markup. With exactly the problem you
are facing. And I had some trouble with tiddler transclusion, because
it makes the DOM structure much deeper. ...

In vanilla TW markup you have eg:

!heading
text text text
* list
* list
text text

If you introduce more whitespace, which increases source readability,
vanilla TW renders it somewhat ugly.

In some of my TWs I am using LineBreakHack, which allows me to add
additional whitespace.  eg:

!heading

text text text

* list
* list

text text

IMO this makes TW markup more readable. It introduces some more
<br>'s, and would make your "purpleater" more effective. But this type
of TW markup is terribly ugly, if you render it with a vanilla TW.
That's why I disabled it for my TiddlySpace, because of sucked in
tiddlers in other spaces.

=====
With vanilla markup, you have to deal with different combinations,
that indicate the start of a new paragraph.
eg:
<h1>textnode
<ul>textnode
....

and the end of a paragraph
textnode<br><h?>, <br><ol>, ul ...

exactly your problem. But having to look back and forth in a recursiv
programm (my attempts are recursive), increases complexity.

Reducing the splitter to one <br> only, you will have a problem within
paragraps, since sometime you need a linebreak inside a paragraph. And
you have to check for combinations I listed above.

Also inline <html> introduces some trouble, if it contains paragraphs
<p> allready.

TiddlyTools HTMLFormattingPlugin doesn't interfere, if you take care
that the postProcessor is the last plugin, which processes the DOM.

...
I have to have a look at my source, and my test TWs, if I figured out
some more special cases, I tried to deal with :)

> This suggests that a bit more brains are needed than the simple split.
>
> Before I dive too deeply into figuring this out I thought I ought to
> ask the community to see if anyone has worked on something similar.
I'd be happy to do some testing if needed.

-m

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

Reply via email to