Author: ayg
Description:
Per the title. Currently if I want to give a list attributes of any kind, I
have to use the relatively unsightly HTML syntax. Tables, table rows, and table
cells can all be given attributes elegantly; I suggest we extend the same syntax
to lists.
- attributes for list | attributes for first list item | item content
- attributes for second list item | item content
Now, obviously stray pipes would cause breakage in a simplistic implementation.
Therefore, the parser would need to verify that the seeming attributes are
actually attribute-like before considering them attributes (as well as, of
course, stripping unwanted attributes). If a reasonable check like that is
made, I anticipate no existing list on all of Wikimedia servers would break
(there may be lists of HTML attributes *with* values, but those aren't going to
include pipes).
- | attributes for first list item | item content with no list-wide attributes
due to empty list-wide-attribute section
- | that pipe is printed literally, unlike the pipe above, because of potential
for collision (and anyway it's not useful)
: if (a || b) "if (a" doesn't look like an attribute, so it's literal
: style="text-indent: 1em;" | ++a; That's a valid attribute, so it's
interpreted as an attribute
: string="Hello, world!" | d ? exit() : continue; // This is so unlikely that we
probably want to consider it an attribute to save parser time (i.e., whatever
matches /[\t ]*([a-z]+ *= *['"]?.*?['"]? +)+/i or whatever)
The same could be extended to initial whitespace, i.e., wiki-<pre>. (I actually
wanted that just today: I had something where I wanted the formatting but not
the background and border.) In fact, if anything this is more useful than the
preceding, because if you have wikimarkup inside the content there's no way to
get a <pre> tag with attributes (which is why [[Family tree of the Greek gods]]
still has that rather ugly grey background).
attributes for <pre> | content
this is part of the same <pre>, so this is content despite the pipe | more content
. . .
Version: unspecified
Severity: enhancement