Question
After I upgraded to twiki feb 2003, a twikidraw %DRAWING{..}% will not be rendered anymore in a table cell. This dos not happen with other similarly formatted plugin variables such as %CALC{....}%
As an example, the following input text:
| %CALC{1+1}% | %CALC{2+2}% |
| %DRAWING{1}% | %DRAWING{2}% |
Produces this HTML:
<p />
<p />
<table border="1" cellspacing="1" cellpadding="0">
<tr><td bgcolor="#FFFFCC"> 1+1 </td><td bgcolor="#FFFFCC"> 2+2 </td></tr>
</table>
| <a href="http://foo.com/cgi-bin/twiki/oops/Sandbox/TestTopic2?template=twikidraw&param1=1" onMouseOver="window.status='Edit drawing [1] using TWiki Draw applet (requires a Java 1.1 enabled browser)';return true;"onMouseOut="window.status='';return true;"><img src="/twiki/pub/Sandbox/TestTopic2/1.gif" alt="Edit drawing '1' (requires a Java enabled browser)"></a>
| <a href="http://foo.com/cgi-bin/twiki/oops/Sandbox/TestTopic2?template=twikidraw&param1=2" onMouseOver="window.status='Edit drawing [2] using TWiki Draw applet (requires a Java 1.1 enabled browser)';return true;"onMouseOut="window.status='';return true;"><img src="/twiki/pub/Sandbox/TestTopic2/2.gif" alt="Edit drawing '2' (requires a Java enabled browser)"></a>
|
-- <a href="/cgi-bin/twiki/view/Main/GerritJanBaarda">GerritJanBaarda</a> - 03 Oct 2003
<p />
<p />
(I changed the real server name to 'foo.com')
As you can see the drawings are not rendered as table cells.
Am I doing something stupid or should this really be a bug report?
Environment
| TWiki version: |
TWikiRelease01Feb2003 |
| TWiki plugins: |
ChartPlugin, ExplicitNumberingPlugin, FormFieldsPlugin, GaugePlugin, InterwikiPlugin, MathModePlugin, NavbarPlugin, SmiliesPlugin, SpreadSheetPlugin, TWikiDrawPlugin, TablePlugin, TreePlugin |
| Server OS: |
Debian woody |
| Web server: |
Apache |
| Perl version: |
5.6.1 |
| Client OS: |
Linux |
| Web Browser: |
IE, Mozilla |
--
GerritJanBaarda - 03 Oct 2003
Answer
The CALC formulas do not introduce newlines, so they work in tables. It seems like the DRAWING variable gets expanded into more then one line, which breaks TWiki tables. Made-up example before the variable expansion:
| *Variable* | *Value* |
| %VARIABLE{...}% | 5 |
After the expansion: (assuming two lines)
| *Variable* | *Value* |
| line 1
line 2 | 5 |
which breaks the table.
Fix: Use an HTML table around your drawings; or change the
TWikiDrawPlugin to not introduce newlines.
--
PeterThoeny - 26 Oct 2003
Thanks! I solved it by removing a newline character in TWikiDrawPlugin.pm:
diff -r1.1 TWikiDrawPlugin.pm
1a2
> #
93c94
< return "<img $img>\n$map";
---
> return "<img $img>$map";
106c107
< "(requires a Java enabled browser)\"></a>\n";
---
> "(requires a Java enabled browser)\"></a>";
This doesn't seem to effect other behaviour.
--
GerritJanBaarda - 03 Nov 2003