Topic: Problem regarding 'balance' together with 'make_tag_strict'
Hi Patanik,
this issue is probably related to the Post "Making 'span' like 'div'"
<HTML>
<BODY BGCOLOR="white"><FONT FACE="Arial, Helvetica">
<CENTER><FONT SIZE="+2" COLOR="#000080"><B>
List of Sessions
</B></FONT></CENTER><BR>
<CENTER>
<FONT COLOR="#505050">
Cell Manager: SRVTAR1
<BR>
Creation Date: 15.05.2012 07:00:06
</FONT>
</CENTER>
<BR><BR>
<CENTER><TABLE BORDER="1" CELLSPACING="0" CELLPADDING="2" WIDTH="95%">
<TR>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white">Session Type</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white">Specification</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white">Status</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white">Mode</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white">Start Time</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white">Queuing</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white">Duration</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white">GB Written</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white"># Media</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white"># Errors</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white"># Warnings</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white"># Files</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white">Success</FONT></TH>
<TH BGCOLOR="#000080"><FONT FACE="Arial, Helvetica" COLOR="white">Session ID</FONT></TH>
</TR>
<TR>
<TD BGCOLOR="white" ALIGN="LEFT"><FONT FACE="Arial, Helvetica">Backup</FONT></TD>
<TD BGCOLOR="white" ALIGN="LEFT"><FONT FACE="Arial, Helvetica">Linux Fileserver NTSRV1</FONT></TD>
<TD BGCOLOR="white" ALIGN="LEFT"><FONT FACE="Arial, Helvetica"><FONT COLOR="green">Completed/Errors</FONT></FONT></TD>
<TD BGCOLOR="white" ALIGN="LEFT"><FONT FACE="Arial, Helvetica">full</FONT></TD>
<TD BGCOLOR="white" ALIGN="LEFT"><FONT FACE="Arial, Helvetica">14.05.2012 23:45:05</FONT></TD>
<TD BGCOLOR="white" ALIGN="RIGHT"><FONT FACE="Arial, Helvetica">0:00</FONT></TD>
<TD BGCOLOR="white" ALIGN="RIGHT"><FONT FACE="Arial, Helvetica">4:42</FONT></TD>
<TD BGCOLOR="white" ALIGN="RIGHT"><FONT FACE="Arial, Helvetica">771,81</FONT></TD>
<TD BGCOLOR="white" ALIGN="RIGHT"><FONT FACE="Arial, Helvetica">2</FONT></TD>
<TD BGCOLOR="white" ALIGN="RIGHT"><FONT FACE="Arial, Helvetica">6</FONT></TD>
<TD BGCOLOR="white" ALIGN="RIGHT"><FONT FACE="Arial, Helvetica">8</FONT></TD>
<TD BGCOLOR="white" ALIGN="RIGHT"><FONT FACE="Arial, Helvetica">2111887</FONT></TD>
<TD BGCOLOR="white" ALIGN="RIGHT"><FONT FACE="Arial, Helvetica"><CENTER><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%" HEIGHT="100%"><TR><TD BGCOLOR="green" WIDTH="100"><FONT FACE="Arial, Helvetica"> </FONT></TD></TR></TABLE></CENTER></FONT></TD>
<TD BGCOLOR="white" ALIGN="LEFT"><FONT FACE="Arial, Helvetica">2012/05/14-9</FONT></TD>
</TR>
</TABLE></CENTER>
<BR><P><BR><P>
</FONT></BODY>
</HTML>
if I use a config like that
$htmLawed_config = array('comment'=>1,
'keep_bad'=>6,
'balance'=>1,
'tidy'=>1,
'elements' => "* -script",
'schemes'=>'href: file, ftp, http, https, mailto; src: cid, data, file, ftp, http, https; *:file, http, https',
'hook_tag' =>"hl_email_tag_transform",
);
I run into the situation that make_tag_strict is turning the first font tag into a span tag; with balance switched on, the expected table is crippled as in the process of tag balancing a span may only hold inline elements as childs.
I may use the suggested change "Making 'span' like 'div'" - adding span to $cF and $eB and removing it from $cI and $eI, or switching balancing off, which results in other unwanted effects elsewhere.
If I switch off make_tag_strict its the same as font is not part of the $cF and $eB arrays, by trading off the benefits of make_tag_strict.
I considered using div as replacement for the span tag when running into font elements in hl_tag2.
This works with the particular example, but may fail elsewhere.
Any suggestions?