Unnecessary spaces in tags, use of lf/crlf
-
Some unnecessary spaces (marked with “
_
“) can be found in tagstd
/th
of the generated table html of plugin version 1.3.1, e.g.<tr><td_ style=”width:25%”_>Item</td>
<td_ style=”width:75%”_>Value</td>
</tr><tr><td_>Item 2</td>
<td_>Value 2</td>
</tr>The spaces are caused by variable
$attr
and line 377 ineasy-table.php
$output .= "<$thtd $attr>".do_shortcode($cell)."</$thtd>\n";
A small change removes these spaces if you replace line 377 with something like this:
$attr = trim( $attr ); if ( !empty( $attr ) ) $attr = ' ' . $attr; $output .= "<$thtd$attr>".do_shortcode($cell)."</$thtd>\n";
Result:
<tr><td style=”width:25%”>Item</td>
<td style=”width:75%”>Value</td>
</tr><tr><td>Item 2</td>
<td>Value 2</td>
</tr>Some more unnecessary spaces can be found e.g. in
table
tag.Second “code-cosmetic” note: To create a linefeed in html source, the generated table html currently has a mix of
\n
and\r\n
, would suggest the use of\r\n
everywhere.Thanks for the great plugin.
- The topic ‘Unnecessary spaces in tags, use of lf/crlf’ is closed to new replies.