| 87 | |
| 88 | ---- |
| 89 | |
| 90 | While multiple urls, images, b's, etc are no problem, this is not the case with lists. I edited the middle part to the following to achieve this: |
| 91 | {{{ |
| 92 | temp = '' |
| 93 | p = re.compile(r'\[list\](.+?)\[/list\]', re.DOTALL) |
| 94 | m = p.search(value) |
| 95 | while m: |
| 96 | items = re.split(re.escape('[*]'), m.group(1)) |
| 97 | for i in items[1:]: |
| 98 | temp = temp + '<li>' + i + '</li>' |
| 99 | value = p.sub(r'<ul>'+temp+'</ul>', value, 1) |
| 100 | m = p.search(value) |
| 101 | temp = '' |
| 102 | p = re.compile(r'\[list=(.)\](.+?)\[/list\]', re.DOTALL) |
| 103 | m = p.search(value) |
| 104 | while m: |
| 105 | items = re.split(re.escape('[*]'), m.group(2)) |
| 106 | for i in items[1:]: |
| 107 | temp = temp + '<li>' + i + '</li>' |
| 108 | value = p.sub(r'<ol type=\1>'+temp+'</ol>', value, 1) |
| 109 | m = p.search(value) |
| 110 | temp = '' |
| 111 | return mark_safe(value) |
| 112 | }}} |
| 113 | I don't know if this has side effects though... -- Hede |