> but surely, a paragraph does not need to be an inset.
> 
> paragraph in paragraph
> 
> heading
> paragraph 1
> 
> subheading
> paragraph 2
> 
> How do we store this?

I have come to the conclusion that I prefer that we just
store this as a list of four paragraphs.

The trouble of nesting this structure into a tree is not worth it:
It decreases efficiency, because going from the subheading to the
paragraph 1 would not be constant time in general (but rather
linear in the depth of the tree.)  Also, it makes the algorithms
for changing a subheading to a heading more complicated.

The only benefit we would have from this (AFAIKS), would be to make it
easier to present the table-of-contents as a tree.  However, I'd
prefer that we did this with a table-of-contents iterator that
would expose the data structure like such.  This can be implemented
to run in linear time, and we save the trouble attached to the tree
handling mentioned above.

However, this does not resolve the issue of whether a paragraph should
be an inset or not.

Greets,

Asger

Reply via email to