Here is an easier solution:
<tr><td style="width:15%"></
td><td>{{=XML(joke.joke.joketext.replace('\n','<br />'),
sanitize=True)}}</td>
<td style="width:25%"> {{=joke.auth_user.first_name}}
{{=joke.auth_user.last_name}}</td></tr>
All I really wanted. Didn't need the rest of markdown or markmin.
BTW, MARKMIN also pads the top of the text. Curious why this is so
but got what I wanted: just use Python.
On Feb 9, 10:22 am, Lewis <[email protected]> wrote:
> Markdown display using the imported WIKI function shifts text down by
> about 1/2em (one half of a line). This is very annoying in a table
> which no longer lines up vertically. The markdown rendered text
> column shows up below the other columns across a row. This just looks
> bad. Is there any reason for the extra vertical padding before the
> text? It is not part of the markdown "specification" from Gruber.
>
> Negative padding on the top doesn't fix this. Even -1px causes most
> the the rows to display nothing in the column at all, probably because
> of a slight collision with the bottom of the preceding row.
>
> Grrrr. All I want is proper line breaks between paragraphs to display
> and this appeared to be the easiest way to do it without parsing all
> of the text and inserting <br> tags at every hard return.
>
> There is also a minor bug in the __init__ function for markdown where
> the WIKI function is defined:
>
> from markdown2 import *
> from gluon.html import XML
>
> def WIKI(text, encoding="utf8", safe_mode='escape', html4tags=False,
> **attributes):
> if not text:
> test = ''
> if attributes.has_key('extras'):
> extras = attributes['extras']
> del attributes['extras']
> else:
> extras=None
> text = text.decode(encoding,'replace')
>
> return XML(markdown(text,extras=extras,
> safe_mode=safe_mode, html4tags=html4tags)\
> .encode(encoding,'xmlcharrefreplace'),**attributes)
>
> It's pretty clear that it should be if not text: text = ''