Opened 13 years ago

Last modified 13 years ago

#78 closed defect (FIXED)

Rich descriptions in MediaEntries

Reported by: Christopher Allan Webber Owned by: joar
Priority: minor Milestone: 0.0.3
Component: programming Keywords:
Cc: Parent Tickets:


Similar to
` <>`_
we should have descriptions be in markdown, and then we should
prerender them and display that prerendered niceness.


    >>> entry['description'] = 'I am *soooo* hungry!'
    >>> entry.render_body()
    >>> entry['description_rendered']
    u'<p>I am <em>soooo</em> hungry!</p>'

Change History (12)

comment:1 by Christopher Allan Webber, 13 years ago

Don't forget to escape:




comment:2 by Elrond, 13 years ago

As I noted on irc:
I don't think, that storing the rendered html in the main table is
a good idea. I would suggest some (persistent) cache.
As markdown seems to have options: We don't want to regenerate all
entries. It's much simpler to kill the cache and regenerate things
as they're needed.

comment:3 by joar, 13 years ago

Sent merge request,
`\_requests/11 <>`_

comment:4 by joar, 13 years ago

Regarding markdown:


    12/16:42.36 < paroneayea>
    12/16:43.19 < paroneayea> text = img.sub('', text) #remove images
    12/16:43.21 < paroneayea> haha
    12/16:44.25 < paroneayea> man they do it twice in that function
    12/16:44.32 < paroneayea> I wonder if that's intentional or an accident
    12/16:45.33 < jwandborg> hah, that's a straight forward solution at least
    12/16:48.34 < paroneayea> jwandborg:
              this also looks like a solution
    12/16:48.53 < paroneayea> but we'll want to make sure we can avoid the evil-javascript-attack issue that hit reddit a
                              while ago still
    12/16:49.24 < jwandborg> The encoded javascript?
    12/16:49.36 < jwandborg> jibberish characters that execute as javascript?
    12/16:49.45 < paroneayea> yeah, I think it was:
    12/16:50.49 < jwandborg>

comment:5 by Christopher Allan Webber, 13 years ago

So a few things before I think this is mergeable.

-  I thought we could avoid implementing an html\_cleaner function
   for now by going the markdown route but it seems I'm wrong:
   ` <>`_
   ` <>`_
   ... it seems like we need an html\_cleaner method regardless and
   always need to run this output through it. I'll make a bug for that
-  It would be good to move the in-function import of markdown to
   the top of the relevant module.
-  This work is looking really good! I'd appreciate it if continued
   work on it until it becomes mergeable would happen in its own
   branch... per-feature branches make my life easier by a lot.

comment:6 by Christopher Allan Webber, 13 years ago

` <>`_
as we now have util.html\_cleaner() :)

comment:7 by joar, 13 years ago

Pushed updates to
[\ :sub:`jwandborg/mediagoblin/jwandborgs-mediagoblin/commits/issue\_363](`\ jwandborg/mediagoblin/jwandborgs-mediagoblin/commits/issue\_363)

comment:8 by Christopher Allan Webber, 13 years ago

One more thing, and that's that I think we need to add migrations.
But I can probably get to that myself if you don't have time.

comment:9 by Christopher Allan Webber, 13 years ago

Status: NewResolved
I added the migration and merged this. Run "./bin/gmg migrate" to
get your existing mediaentries migrated.

Super excited to have this in... thanks SO MUCH Joar!

comment:10 by Christopher Allan Webber, 13 years ago

This is strange. This bug doesn't seem to have any way of marking
it as closed?!

comment:11 by Christopher Allan Webber, 13 years ago

Status: ResolvedClosed
I see. It was previously blocked by
` <>`_
but I removed the block. Closed now!

comment:12 by Will Kahn-Greene, 12 years ago

The original url for this bug was .
#337: related

Note: See TracTickets for help on using tickets.