Ticket #81 (reopened defect)

Opened 10 months ago

Last modified 7 weeks ago

indenting lists

Reported by: volker Owned by: ralf
Priority: critical Component: mwlib
Keywords: Cc:

Description (last modified by volker) (diff)

sometimes people seem to try to build nested list in a wrong way. the mediawiki renders that ok (as long as you don't look at the generated html ;-) )

currently we do not parse the combination of indentation and lists a :* is the same as *:

the best thing to do (in my opinion) would be to parse :* as ** and so on (even though is syntactically not correct).

alternatively we could parse it as an indented node which contains a list (and a list item)

In [7]: a = '* blub\n:* bla'

In [8]: uparser.simpleparse(a)
parser.info >> Parsing "'unknown'"
 Article 'unknown': 1 children
     Paragraph '': 1 children
         Node '': 2 children
             ItemList '': 1 children
                 Item '': 1 children
                     ' blub'
             ItemList '': 1 children
                 Item '': 1 children
                     ' bla'
Out[8]: Article 'unknown': 1 children

Change History

  Changed 8 months ago by volker

  • description modified (diff)

  Changed 7 weeks ago by heiko

  • priority changed from major to critical

follow-up: ↓ 4   Changed 7 weeks ago by ralf

  • status changed from new to closed
  • resolution set to fixed

very critical, I implemented your suggestion. let's see what happens... unfortunately I already pushed it to code.pediapress.com...should have done that.

in reply to: ↑ 3   Changed 7 weeks ago by ralf

Replying to ralf:

very critical, I implemented your suggestion. let's see what happens... unfortunately I already pushed it to code.pediapress.com...should have done that.

should *not* have done that...sorry

  Changed 7 weeks ago by volker

  • status changed from closed to reopened
  • resolution deleted

You should also not have listened to your colleagues. My initial suggestion was bad.

I guess we should do it exactly like the mediawiki parser does it even if the result is - in my opinion - pretty ridiculous:

* normal item
*: special <nowiki>*:</nowiki>
* normal item
:* special <nowiki>:*</nowiki>
* normal item
<ul>
  <li>normal item
    <dl>
      <dd>special *:</dd>
    </dl>
  </li>
  <li>normal item</li>
</ul>


<dl>
  <dd>
    <ul>
      <li>special :*</li>
    </ul>
  </dd>
</dl>

<ul>
  <li>normal item</li>
</ul>

Also note that combinations like :*:**::** are perfectly valid, even though insane, mediawiki markup

Note: See TracTickets for help on using tickets.