Restrict to HTML Table - Textpipe 8.3.7

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
Josiah Hincks
Posts: 5
Joined: Sun Sep 13, 2009 5:38 pm

Restrict to HTML Table - Textpipe 8.3.7

Post by Josiah Hincks »

I am using the excellent Restriction filters to help me upgrade many HTML files.

BUT I am having problems with Restricting nested HTML tables and need to clarify what I can expect the filter to cope with. I am not sure if this is a "bug" or a "limit".

My query--should the filter be able to cope with any level of nesting in tables? Since nesting is very common in code for HTML tables I was a little surprised that this ...

Code: Select all

<table border="1">
<tr>
  <td>
   <p>This is a paragraph</p>
   <p>This is another paragraph</p>
  </td>
  <td>This cell contains a table:
   <table border="1">
   <tr>
     <td>A</td>
     <td>B</td>
   </tr>
   <tr>
     <td>C</td>
     <td>D</td>
   </tr>
   </table>
  </td>
</tr>
<tr>
  <td>This cell contains a list
   <ul>
    <li>apples</li>
    <li>bananas</li>
    <li>pineapples</li>
   </ul>
  </td>
  <td>HELLO</td>
</tr>
</table>
... produces this under a Table Restriction ... (the lines starting [+++RESTRICTION] are what are in the restriction)

Code: Select all

[+++RESTRICTION]<table border="1">
[+++RESTRICTION]<tr>
[+++RESTRICTION]<td><p>This is a paragraph</p><p>This is another paragraph</p> </td>
[+++RESTRICTION]<td>This cell contains a table:
[+++RESTRICTION]<table border="1">
[+++RESTRICTION]<tr>
[+++RESTRICTION]<td>A</td>
[+++RESTRICTION]<td>B</td>
[+++RESTRICTION]</tr>
[+++RESTRICTION]<tr>
[+++RESTRICTION]<td>C</td>
[+++RESTRICTION]<td>D</td>
[+++RESTRICTION]</tr>
[+++RESTRICTION]</table>
</td>
</tr>
<tr>
<td>This cell contains a list
<ul>
<li>apples</li>
<li>bananas</li>
<li>pineapples</li>
</ul> </td>
<td>HELLO</td>
</tr>
</table>
This seems to indicate that the Restriction is ALWAYS from the first instance of <table> to the first instance of </table>. Have I understood this correctly? And, if so, is that the intended behaviour? If it is intended it will give unintended results on any table that is nested.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Restrict to HTML Table - Textpipe 8.3.7

Post by DataMystic Support »

Sorry - This is a limitation of most pattern matches - they cannot cope with nesting.
Post Reply