[pmwiki-users] proposed markup for rowspan in simple tables
john.rankin at affinity.co.nz
john.rankin at affinity.co.nz
Wed Aug 27 04:48:01 CDT 2008
> On Tue, Aug 26, 2008 at 10:15 PM, <john.rankin at affinity.co.nz> wrote:
>> Are there any reasons not to use:
>>
>> ||text||this spans 3 rows+++ ||
>> ||more||
>> ||more||
>> ||text||text||
>
> I say go for it... I think this will do the job admirably.
>
> -Peter
>
## rowspan in simple tables
Markup('||==', '>^||',
'/(<t[dh][^>]*>.*?)(\+\++)/e',
"CellRowspan(PSS('$1'),strlen('$2'))");
function CellRowspan($string,$r) {
return
preg_replace('/^((?:<t[dh][^>]*>.*?<\/t[dh]>)*)(<t[dh][^>]*)(>.*?)$/',
'$1$2 rowspan="'.$r.'"$3',$string);
}
There ought to be a simpler solution, but I'm not a regexpert.
It's easier to add it to the core, which works one cell at a time.
JR
More information about the pmwiki-users
mailing list