00820: Unintuitive apply=block behavior

Summary: Unintuitive apply=block behavior
Created: 2006-10-21 18:34
Status: Closed - not a bug
Category: Bug
From: RK?
Assigned:
Priority: 3
Version: 2.1.26
OS: N/A

Description: When applying a style to a block, intuitively the following three examples should behave the same:

%red apply=block%
(style followed by newline)

%red apply=block% 
(style followed by space and newline)

%red apply=block% (documented syntax)

(style followed by newline)

(style followed by space and newline)

(documented syntax)

The second and third examples will produce red text; the first will not, but it appears identical to the second. One would expect the first example to be interpreted as:

<p> (style followed by newline) </p>

Block styles become more awkward when applied to lists. To me, the most reasonable syntax is:

%red apply=block%
* a
* b

  • a
  • b

rather than:

* %red apply=block% 
* a (note the space ^)
* b
  • a (note the space ^)
  • b

or, worst,

* %red apply=block% a
* b
  • a
  • b

which obscures the first list item and implies the style is applied to the first item, not the whole list. Interestingly, in these examples the block style is applied to both the <ul> and the first <li>, e.g.

<ul style='color: red;'><li style='color: red;'> a
</li><li>b
</li></ul>


Agreed that the style+space and style on a line-by-itself ought to do the same thing.

In the case of apply=block, it's designed such that it applies to the block that the wikistyle is in, not to the block that follows. Thus, putting %red apply=block% on a non-list line means the block isn't the list.

In order to get a wikistyle to apply to a single item, use apply=item (or even just %item%).

Thanks!

Pm