Opened 22 months ago

Closed 22 months ago

Last modified 20 months ago

#10724 closed enhancement (duplicate)

[PATCH] render inner macros inside the SQLTable macro

Reported by: falkb Owned by: rjollos
Priority: normal Component: WikiTableMacro
Severity: normal Keywords:
Cc: Trac Release:


Imagine this construct:

  ( SELECT value FROM session_attribute WHERE name='pagemoderator' AND Sid=m.Sid ) AS "Standard",
  "[[Image(" || REPLACE(
                                   ( SELECT value FROM session_attribute WHERE name='picture_href' AND Sid=m.Sid ), '/myproject/raw-attachment/wiki/', '' ), '/', ':')
                       || ", center, 50px)]][[BR]]" ||   ( SELECT value FROM session_attribute WHERE name='name' AND Sid=m.Sid ) AS "Moderator",
  ( SELECT value FROM session_attribute WHERE name='email'          AND Sid=m.Sid ) AS "Email"
  session_attribute m
  name='pagemoderator' AND NOT value=''

The following patch let the table appear with all bells and whistles:

  • wikitablemacro/trunk/wikitable/

    1414from trac.core import implements 
    1515from import ITemplateProvider, add_stylesheet 
    1616from import system_message 
     17from import wiki_to_html 
    1718from import WikiMacroBase 
    1819from trac.util.html import Markup 
    1920from trac.util.text import exception_to_unicode 
    6465            css_class = (idx % 2 == 0) and 'odd' or 'even' 
    6566            print >> out, "  <tr class='%s'>" % css_class 
    6667            for col in row: 
    67                 print >> out, "<td>%s</td>" % col 
     68                text = wiki_to_html(StringIO(col).getvalue(), self.env, req) 
     69                print >> out, "<td>%s</td>" % text 
    6870            print >> out, "  </tr>" 
    7072        print >> out, " </tbody>" 

Attachments (0)

Change History (6)

comment:1 Changed 22 months ago by falkb

probably solves #4452

comment:2 Changed 22 months ago by anonymous

Thanks, I'm testing it out now. Note that wiki_to_html is deprecated, and format_to_html should be used instead.

comment:3 Changed 22 months ago by rjollos

(In [12459]) Refs #4452, #10724: Parse table data as wiki markup and format to HTML.

comment:4 Changed 22 months ago by rjollos

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #4452, please follow-up in that ticket.

comment:5 Changed 22 months ago by anonymous

oh yeah, I reinvented the wheel, didn't read it there :)

comment:6 Changed 20 months ago by rjollos

#10814 is a regression ticket against [12459].

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.