= Description =

If a table has more than one wiki-like markup option, like tableclass and tablestyle together within {{{<...>}}}, then it messes up the parsing of the table.

The wiki-like markup includes the words {{{style rowstyle tablestyle class rowclass tableclass id}}}.  If any two of these words appear in one {{{<...>}}}, none of the style applies.  Examples are given below.  Note that this did not happen under 1.3.5; I've used 1.5RC4, 1.5.0 and 1.5.1 and all of them give the same buggy behaviour.

== Steps to reproduce ==

 1. Create a table with {{{<tablestyle="float:right;" tableclass="myclass">}}} and the only styling it gets is {{{class="float:right;"}}}.

== Example ==

The first 2 tables below are styled correctly, the last one should have an aqua background and class "foobar" but doesn't.

=== Table with class ===

Wiki  markup 
{{{||<tableclass="foobar"> Table with class || Two ||
||class="foobar"||Four||}}}
produces HTML (I've fiddled with the whitespace)
{{{<table class="foobar">
<tr><td><p> Table with class </p></td>
    <td><p> Two </p></td></tr>
<span id="line-16" class="anchor"></span>
<tr><td><p>class="foobar"</p></td>
<td><p>Four</p></td></tr>
<span id="line-17" class="anchor"></span></table>}}}

On this wiki, the output is
||<tableclass="foobar"> Table with class || Two ||
||class="foobar"||Four||
At the time of writing this, the output was {{attachment:class.png}}

=== Table with style ===

Wiki markup 
{{{||<tablestyle="background-color: aqua;">Table with style||Two||
||style="background-color: aqua;"||Four||}}}
produces HTML 
{{{<table style="background-color: aqua;">
<tr><td><p>Table with style</p></td>
<td><p>Two</p></td></tr>
<span id="line-19" class="anchor"></span><tr>
<td><p>style="background-color: aqua;"</p></td>
<td><p>Four</p></td></tr>
<span id="line-20" class="anchor"></span></table>}}}

On this wiki, the output is
||<tablestyle="background-color: aqua;">Table with style||Two||
||style="background-color: aqua;"||Four||

At the time of writing this, the output was {{attachment:style.png}}

=== Table with class and style ===

{{{||<tableclass="foobar" tablestyle="background-color: aqua;"> Style and class || Two ||
||as above||Four||}}}
produces HTML
{{{<table class="background-color: aqua;">
<tr><td><p> Style and class </p></td>
<td><p> Two </p></td></tr>
<span id="line-22" class="anchor"></span><tr>
<td><p>as above</p></td>
<td><p>Four</p></td></tr>
<span id="line-23" class="anchor"></span></table>}}}

On this wiki, the output is
||<tableclass="foobar" tablestyle="background-color: aqua;"> Style and class || Two ||
||as above||Four||

At the time of writing this, the output was {{attachment:styleandclass.png}}


== Details ==

This Wiki.
## if the bug is in this wiki, just kill the table and write: This Wiki.

## If a traceback is not available, please fill in the details here:
## || '''!MoinMoin Version''' || 1.5.1 ||
## || '''OS and Version''' ||  ||
## || '''Python Version''' ||  ||
## || '''Server Setup''' || ||
## || '''Server Details''' || ||


== Workaround ==
## How to deal with the bug until it is fixed
Only solution is to rewrite all your tables. :-(

 No. Parsing of table attributes was broken by patch submitted as fix to MoinMoinBugs/TableHtmlKeywordsNotParsed.
 Real solution to that and this bug would be:
 {{attachment:wiki.py.patch}} committed to moin--main--1.5--patch-408

 (`attrdef.split('=')[0]` always gets first and only attribute from `attrdef` so in effect resulting html-element receives single attribute with a name of first and value of last  attribute from the source attribute sequence.

 `table_extension()` just need to leave entire name=value pair to `parseAttributes()` when none of its special cases applyes to a given token -- it must return `None`)
 
 {{{||<tableclass="foobar" tablestyle="background-color: aqua;"> Style and class || Two ||
||as above||Four||}}}
 would produce HTML
 {{{
<table style="background-color: aqua;" class="foobar">
<tr><td><p> Style and class </p></td><td><p> Two </p></td></tr>
<span id="line-9" class="anchor"></span>
<tr><td><p>as above</p></td><td><p>Four</p></td></tr>
<span id="line-10" class="anchor"></span>
</table>
}}}

= Discussion =
 * This is a much nicer patch :-) -- ReimarBauer <<DateTime(2006-01-28T09:35:06Z)>>
 * Worked for me.  Walter Gildersleeve <<Date(2006-01-28T21:55:11Z)>>

= Plan =
## This part is for Moin``Moin developers:

 * Priority: 
 * Assigned to:
 * Status: committed to moin--main--1.5--patch-408

----
## If you are a moin core developer, replace the category to Category* in these cases:
## Category MoinMoinNoBug - if this is not a bug.
## Category MoinMoinBugConfirmed - if you can confirm the bug on current code.
## Category MoinMoinBugFixed - after the bug is fixed in current code.
CategoryMoinMoinBugFixed