MWTable does not work correctly
- Status
- Open
- Subject
- MWTable does not work correctly
- Version
- 3.x
6.x - Category
- Less than 30-minutes fix
- Feature
- Wiki Plugin (extends basic syntax)
- Submitted by
- DesertWolf
- Lastmod by
- DesertWolf
- Rating
- Description
if you use the example of the mwtable plugin
Copy to clipboard{MWTABLE( wiki_classes=false )} style="width:50%", class="myclass" |+style="font-style:italic;"|My caption ? width="30%;" ?? style="background-color:yellow;" ! style="background-color:grey;"| Name ! Address |- style="background-color: red" | style="color: blue;" | Bill | The little house |- | Carol || The big house {MWTABLE}
you will get something like this:Copy to clipboard<table style="" width:50%="" ,="" class="normal br"> <caption style="" font-style:italic;=""> My caption<br></caption> <col 30%;="" width=""> <col style=""> <tbody><tr> <th style="" background-color:grey;="">Name<br></th> <th>Address<br></th> </tr> <tr style="" background-color:=""> <td style="" color:="">Bill<br></td> <td>The little house<br></td> </tr> <tr> <td>Carol</td> <td>The big house<br></td> </tr> </tbody></table>
you see that the attributes are not translated right.as well there is a problem with a space like "color: blue"
and another addition: doesn't recognise colors in hexadecimal format (#rrggbb)
it happens in version 3.x and as well as in version 6.1 i am testing right now.
- Solution
In lines 346/347 of tikidir/lib/wiki-plugins/wikiplugin_mwtable.php you have something like:
Copy to clipboard$value = str_replace("'", "", $value); $value = str_replace(""", "", $value);
add the following line below that:Copy to clipboard$value = str_replace("\"", "", $value);
To fix thespaceand hexadecimal problem change line 342 from:Copy to clipboardif (preg_match("#([(")\"'\w:;%-/\.]+)(?=\s|\Z)#",$string,$matches,PREG_OFFSET_CAPTURE,$cur_pos)) {to
Copy to clipboardif (preg_match("#([(")\"'\w\#:;%-/\.]+)(?=\s|\Z)#",$string,$matches,PREG_OFFSET_CAPTURE,$cur_pos)) {
(moved the /s from the second to the first group)Edit: space problem still not solved
- Importance
- 5
- Priority
- 25
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 3795
- Created
- Tuesday 15 February, 2011 08:58:40 UTC
by DesertWolf - LastModif
- Tuesday 15 February, 2011 11:39:08 UTC