Restrict to HTML Table - Textpipe 8.3.7

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

Restrict to HTML Table - Textpipe 8.3.7

Postby Josiah Hincks » Fri Sep 25, 2009 6:00 pm

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: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Restrict to HTML Table - Textpipe 8.3.7

Postby DataMystic Support » Mon Sep 28, 2009 12:01 pm

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

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 2 guests