HTML table is not rendered.
Following code:

<table>
    <tr><th>subject</th><th>predicate</th><th>object</th></tr>
    <tr>
      <td>Nonsuch Primary School</td>
      <td>local authority ward</td>
      <td>Bartley Green</td>
    </tr>
    <tr>
      <td>Nonsuch Primary School</td>
      <td>free school meals percentage</td>
      <td>47</td>
    </tr>
</table>

is rendered to:


    12subject34predicate56object78
    9
      10Nonsuch Primary School11
      12local authority ward13
      14Bartley Green15
    16
    17
      18Nonsuch Primary School19
      20free school meals percentage21
      224723
    24
CommentFileSizeAuthor
#5 Mediawiki-1196580.patch412 byteskenorb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kenorb’s picture

kenorb’s picture

Title: HTML table is not rendered » HTML tags followed by space are not rendered
kenorb’s picture

I've tested following code:

<pre>Does work!</pre>
  <pre>Doesn't work!</pre>

It's rendered to:

<pre>Does work!</pre><br /> 
<pre>  6Doesn't work!7</pre><br /> 

Why there are some numbers?

Other example with table:


<table>
  <tr>
      <td>Table doesn't work</td>
      <td>Table doesn't work</td>
      <td>Table doesn't work</td>
  </tr>
<tr>
<td>Table does work</td>
<td>Table does work</td>
<td>Table does work</td>
</tr>
</table>

rendered to:

<table><br /> 
<pre>  9
      10Table doesn't work11
      12Table doesn't work13
      14Table doesn't work15
  16</pre><br /> 
<tr><br /> 
<td>Table does work</td><br /> 
<td>Table does work</td><br /> 
<td>Table does work</td><br /> 
</tr><br /> 
</table>

What the hell?

kenorb’s picture

=> $key = 159 pearwiki_filter/Text/Wiki.php:1081
=> $rule = 'Preformatted' pearwiki_filter/Text/Wiki.php:1082
=> $opts = array ('text' => ' \0311\031\0312\031subject\0313\031\0314\031predicate\0315\031\0316\031object\0317\031\0318\031\n ... pearwiki_filter/Text/Wiki.php:1083

Looks like in Preformatted mode (./Text/Wiki/Render/Xhtml/Preformatted.php)
it's encoding the whole line.

    function token($options) {
        $text = $this->textEncode($options['text']);
...
    function textEncode($text) {
        return htmlspecialchars($text);
kenorb’s picture

Version: 5.x-1.x-dev » 6.x-1.0-beta1
Status: Active » Closed (fixed)
FileSize
412 bytes

Bug reported here:
http://pear.php.net/bugs/bug.php?id=18625

Patch attached against Text/Wiki/Mediawiki.php.

Marked as fixed, because it's a patch in 3rd party code.