Fossil

View Ticket
Login
2024-02-03
23:05 Closed ticket [0fd3c7d2]: wiki inserts P tags in tables plus 5 other changes ... (artifact: 38dd720d user: wyoung)
23:03
Disabling the "auto paragraph" feature in the wiki renderer when styling an HTML "table" element. Without this, the first cell's contents gets wrapped in "p" tags, unnecessarily. (None of the other cells are treated thus.) With the trunk default skin, this extra tag was invisible, but with this branch's skin, it shows up as a double-height first row in every table. For tables with a header row, this may appear to be an intentional esthetic choice, but it's not; it's a rendering bug.

Credit for this goes to Stephan Beal (the eminent repo archaeologist) plus whichever "anonymous" posted this ticket, way back in 2010! ... (check-in: 6f94da9b user: wyoung tags: inskinerator-modern-backport)

2010-12-27
13:13 Ticket [0fd3c7d2] wiki inserts P tags in tables status still Open with 1 other change ... (artifact: 0667c879 user: anonymous)
13:01 Ticket [0fd3c7d2]: 2 changes ... (artifact: e78570a0 user: anonymous)
2010-10-07
11:03 New ticket [0fd3c7d2]. ... (artifact: baf9c212 user: anonymous)

Ticket UUID: 0fd3c7d243e74adf4d51d6f36d7d5d294245bac4
Title: wiki inserts P tags in tables
Status: Closed Type: Code_Defect
Severity: Minor Priority: Immediate
Subsystem: Resolution: Drive_By_Patch
Last Modified: 2024-02-03 23:05:13
Version Found In: 12a79e5b93
Description & Comments:
Fossils wiki inserts extra p tags around the first row in the first column of every table, for example:
<table>
 <tr>
  <td>first item</td>
  <td>second item</td>
 </tr>
</table>

renders as

<table>
 <tr>
  <td><p>first item</p></td>
  <td>second item</td>
 </tr>
</table>

anonymous added on 2010-12-27 13:01:03:
The following small patch seems to fix the problem:

Index: src/wikiformat.c
===================================================================
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1404,10 +1404,11 @@
           if( backupToType(p, MUTYPE_TABLE|MUTYPE_TR) ){
             if( stackTopType(p)==MUTYPE_TABLE ){
               pushStack(p, MARKUP_TR);
               blob_append(p->pOut, "", 4);
             }
+            p->wantAutoParagraph = 0;
             pushStack(p, markup.iCode);
             renderMarkup(p->pOut, &markup);
           }
         }else
         if( markup.iType==MUTYPE_HYPERLINK ){

anonymous added on 2010-12-27 13:13:51:
You can use:

<nowiki>
</nowiki>